diff options
author | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-22 18:43:03 -0400 |
---|---|---|
committer | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-22 18:43:03 -0400 |
commit | 31211a9436b7073ee054cbc091ce684a9051efec (patch) | |
tree | b54e3e38c38e76e83083e3d537ae68acd041e733 /internal | |
parent | 6184aba245dce6f9f68e7147f86b943caa508eba (diff) | |
download | donetick-31211a9436b7073ee054cbc091ce684a9051efec.tar.gz donetick-31211a9436b7073ee054cbc091ce684a9051efec.tar.bz2 donetick-31211a9436b7073ee054cbc091ce684a9051efec.zip |
Support linux_386 by changing minChores to int64, remove debugging log for getNotification
Diffstat (limited to 'internal')
-rw-r--r-- | internal/chore/handler.go | 13 | ||||
-rw-r--r-- | internal/notifier/repo/repository.go | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/internal/chore/handler.go b/internal/chore/handler.go index 333521a..16c80ef 100644 --- a/internal/chore/handler.go +++ b/internal/chore/handler.go @@ -1097,12 +1097,12 @@ func checkNextAssignee(chore *chModel.Chore, choresHistory []*chModel.ChoreHisto } } - minChores := math.MaxInt64 + var minChores int64 = math.MaxInt64 for assignee, numChores := range assigneeChores { // if this is the first assignee or if the number of // chores assigned to this assignee is less than the current minimum - if numChores < minChores { - minChores = numChores + if int64(numChores) < minChores { + minChores = int64(numChores) // set the next assignee to this assignee nextAssignee = assignee } @@ -1119,12 +1119,13 @@ func checkNextAssignee(chore *chModel.Chore, choresHistory []*chModel.ChoreHisto } // max Int value - minChores := math.MaxInt64 + var minChores int64 = math.MaxInt64 + for assignee, numChores := range assigneeChores { // if this is the first assignee or if the number of // chores completed by this assignee is less than the current minimum - if numChores < minChores { - minChores = numChores + if int64(numChores) < minChores { + minChores = int64(numChores) // set the next assignee to this assignee nextAssignee = assignee } diff --git a/internal/notifier/repo/repository.go b/internal/notifier/repo/repository.go index 576a3f0..38d1819 100644 --- a/internal/notifier/repo/repository.go +++ b/internal/notifier/repo/repository.go @@ -36,7 +36,7 @@ func (r *NotificationRepository) GetPendingNotificaiton(c context.Context, lookb var notifications []*nModel.Notification start := time.Now().UTC().Add(-lookback) end := time.Now().UTC() - if err := r.db.Debug().Where("is_sent = ? AND scheduled_for < ? AND scheduled_for > ?", false, end, start).Find(¬ifications).Error; err != nil { + if err := r.db.Where("is_sent = ? AND scheduled_for < ? AND scheduled_for > ?", false, end, start).Find(¬ifications).Error; err != nil { return nil, err } return notifications, nil |