Add debug message to find race-condition
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
1f09c0c0ee
commit
bafa9c26f9
1 changed files with 7 additions and 1 deletions
|
@ -53,10 +53,16 @@ func (a *autoMessage) CanSend() bool {
|
||||||
|
|
||||||
case a.Cron != "":
|
case a.Cron != "":
|
||||||
sched, _ := cronParser.Parse(a.Cron)
|
sched, _ := cronParser.Parse(a.Cron)
|
||||||
if sched.Next(a.lastMessageSent).After(time.Now()) {
|
nextExecute := sched.Next(a.lastMessageSent)
|
||||||
|
if nextExecute.After(time.Now()) {
|
||||||
// Cron timer is not yet expired
|
// Cron timer is not yet expired
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
log.WithFields(log.Fields{
|
||||||
|
"lastMessage": a.lastMessageSent,
|
||||||
|
"nextExecution": nextExecute,
|
||||||
|
"now": time.Now(),
|
||||||
|
}).Debug("Auto-Message was allowed through cron")
|
||||||
}
|
}
|
||||||
|
|
||||||
if a.OnlyOnLive {
|
if a.OnlyOnLive {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue