remind: fix segfautl due to broker not initialized yet
This commit is contained in:
parent
def40e8bd7
commit
377aa68cb6
1 changed files with 5 additions and 0 deletions
|
@ -108,6 +108,11 @@ func remind(broker *tg.Broker, update tg.APIMessage) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func runreminder(id string) {
|
func runreminder(id string) {
|
||||||
|
// In case this is called in the init, wait until the broker is available
|
||||||
|
for broker == nil {
|
||||||
|
// Wait
|
||||||
|
}
|
||||||
|
|
||||||
// Get reminder
|
// Get reminder
|
||||||
r := reminders[id]
|
r := reminders[id]
|
||||||
remaining := r.When - time.Now().Unix()
|
remaining := r.When - time.Now().Unix()
|
||||||
|
|
Reference in a new issue