impl config State and config Interval
This commit is contained in:
15
main.go
15
main.go
@@ -2,7 +2,9 @@ package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"local/truckstop/config"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -15,5 +17,16 @@ func _main() error {
|
||||
if err := config.Refresh(); err != nil {
|
||||
return err
|
||||
}
|
||||
return errors.New("not impl")
|
||||
for {
|
||||
if err := once(); err != nil {
|
||||
return err
|
||||
}
|
||||
time.Sleep(config.Get().Interval.Get())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func once() error {
|
||||
states := config.Get().States
|
||||
return errors.New("not impl" + fmt.Sprint(states))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user