Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
Rescheduled reminders trigger correctly now solves Issue #90
Browse files Browse the repository at this point in the history
  • Loading branch information
scottleedavis committed May 24, 2019
1 parent 7948138 commit 41bf050
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/reminder.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (p *Plugin) TriggerReminders() {
}

if occurrence.Repeat != "" {
p.rescheduleOccurrence(&occurrence)
defer p.rescheduleOccurrence(&occurrence)
}

} else if strings.HasPrefix(reminder.Target, "~") { //~ channel
Expand Down Expand Up @@ -293,7 +293,7 @@ func (p *Plugin) TriggerReminders() {
}

if occurrence.Repeat != "" {
p.rescheduleOccurrence(&occurrence)
defer p.rescheduleOccurrence(&occurrence)
}

}
Expand Down Expand Up @@ -508,6 +508,8 @@ func (p *Plugin) DeleteReminders(user *model.User) string {

func (p *Plugin) rescheduleOccurrence(occurrence *Occurrence) {

time.Sleep(1000 * time.Millisecond)

user, _ := p.API.GetUserByUsername(occurrence.Username)
_, locale := p.translation(user)

Expand Down

0 comments on commit 41bf050

Please sign in to comment.