master
Bel LaPointe 2022-01-09 22:29:46 -05:00
parent b5c1c13060
commit a5d42fe556
3 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,5 @@
{ {
"Interval": "1s", "Interval": "1s",
"States": ["NC"] "States": ["NC"],
"Once": true
} }

View File

@ -12,6 +12,7 @@ type Config struct {
Interval Duration Interval Duration
States []State States []State
Storage []string Storage []string
Once bool
lock sync.Mutex lock sync.Mutex
db storage.DB db storage.DB

View File

@ -22,8 +22,12 @@ func _main() error {
if err := once(); err != nil { if err := once(); err != nil {
return err return err
} }
if config.Get().Once {
break
}
time.Sleep(config.Get().Interval.Get()) time.Sleep(config.Get().Interval.Get())
} }
return nil
} }
func once() error { func once() error {