Only send reminders for undone tasks
This commit is contained in:
parent
d69c799197
commit
6bdc1fdb0d
2 changed files with 6 additions and 0 deletions
|
@ -6,3 +6,7 @@
|
||||||
task_id: 27
|
task_id: 27
|
||||||
reminder: 2018-12-01 01:13:44
|
reminder: 2018-12-01 01:13:44
|
||||||
created: 2018-12-01 01:12:04
|
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
|
||||||
|
|
|
@ -106,7 +106,9 @@ func getTasksWithRemindersInTheNextMinute(s *xorm.Session, now time.Time) (taskI
|
||||||
|
|
||||||
reminders := []*TaskReminder{}
|
reminders := []*TaskReminder{}
|
||||||
err = s.
|
err = s.
|
||||||
|
Join("INNER", "tasks", "tasks.id = task_reminders.task_id").
|
||||||
Where("reminder >= ? and reminder < ?", now.Format(dbFormat), nextMinute.Format(dbFormat)).
|
Where("reminder >= ? and reminder < ?", now.Format(dbFormat), nextMinute.Format(dbFormat)).
|
||||||
|
And("tasks.done = false").
|
||||||
Find(&reminders)
|
Find(&reminders)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue