sleep on start before getting email
This commit is contained in:
2
main.go
2
main.go
@@ -22,6 +22,7 @@ func main() {
|
|||||||
lock := &sync.Mutex{}
|
lock := &sync.Mutex{}
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
|
time.Sleep(config.Get().Interval.Email.Get())
|
||||||
if config.Get().EmailerEnabled {
|
if config.Get().EmailerEnabled {
|
||||||
lock.Lock()
|
lock.Lock()
|
||||||
if err := email(); err != nil {
|
if err := email(); err != nil {
|
||||||
@@ -29,7 +30,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
lock.Unlock()
|
lock.Unlock()
|
||||||
}
|
}
|
||||||
time.Sleep(config.Get().Interval.Email.Get())
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
if err := _main(); err != nil {
|
if err := _main(); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user