wip: refactor(config): fix pointer type
This commit is contained in:
parent
22fee125bc
commit
5bae155b3b
@ -40,11 +40,11 @@ func convert(cfg *config.Config) *wConfig {
|
||||
|
||||
func convertSchedule(cfg config.CronTimeSpec) task.CronTimeSpec {
|
||||
switch v := cfg.(type) {
|
||||
case config.SpecAny:
|
||||
case *config.SpecAny:
|
||||
return task.NewCronAnySpec()
|
||||
case config.SpecExact:
|
||||
case *config.SpecExact:
|
||||
return task.NewCronExactSpec(v.Value())
|
||||
case config.SpecMultiOccurrence:
|
||||
case *config.SpecMultiOccurrence:
|
||||
return task.NewCronMultiOccurrenceSpec(v.Values()...)
|
||||
}
|
||||
|
||||
|
||||
@ -5,8 +5,6 @@ import (
|
||||
)
|
||||
|
||||
type Tasks struct {
|
||||
//services []wminit.Path
|
||||
//cron []wminit.Cron
|
||||
services []wminit.Task
|
||||
crones []wminit.CronTask
|
||||
}
|
||||
@ -39,13 +37,11 @@ func (ts *Tasks) List() []wminit.Task {
|
||||
}
|
||||
|
||||
func (ts *Tasks) Services() []wminit.Task {
|
||||
panic("not implemented")
|
||||
return nil
|
||||
return ts.services
|
||||
}
|
||||
|
||||
func (ts *Tasks) Crones() []wminit.CronTask {
|
||||
panic("not implemented")
|
||||
return nil
|
||||
return ts.crones
|
||||
}
|
||||
|
||||
func (ts *Tasks) Get(name string) (wminit.Task, error) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user