sleep on start before getting email

This commit is contained in:
Bel LaPointe
2022-01-11 07:57:11 -05:00
parent 27605997c1
commit 8109bb3fa0

View File

@@ -22,6 +22,7 @@ func main() {
lock := &sync.Mutex{}
go func() {
for {
time.Sleep(config.Get().Interval.Email.Get())
if config.Get().EmailerEnabled {
lock.Lock()
if err := email(); err != nil {
@@ -29,7 +30,6 @@ func main() {
}
lock.Unlock()
}
time.Sleep(config.Get().Interval.Email.Get())
}
}()
if err := _main(); err != nil {