Only send reminders for undone tasks

This commit is contained in:
kolaente 2021-01-31 12:54:15 +01:00
parent d69c799197
commit 6bdc1fdb0d
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 6 additions and 0 deletions

View file

@ -6,3 +6,7 @@
task_id: 27
reminder: 2018-12-01 01:13:44
created: 2018-12-01 01:12:04
- id: 3
task_id: 2
reminder: 2018-12-01 01:13:44
created: 2018-12-01 01:12:04

View file

@ -106,7 +106,9 @@ func getTasksWithRemindersInTheNextMinute(s *xorm.Session, now time.Time) (taskI
reminders := []*TaskReminder{}
err = s.
Join("INNER", "tasks", "tasks.id = task_reminders.task_id").
Where("reminder >= ? and reminder < ?", now.Format(dbFormat), nextMinute.Format(dbFormat)).
And("tasks.done = false").
Find(&reminders)
if err != nil {
return