Support linux_386 by changing minChores to int64, remove debugging log for getNotification
This commit is contained in:
parent
6184aba245
commit
31211a9436
|
@ -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 {
|
for assignee, numChores := range assigneeChores {
|
||||||
// if this is the first assignee or if the number of
|
// if this is the first assignee or if the number of
|
||||||
// chores assigned to this assignee is less than the current minimum
|
// chores assigned to this assignee is less than the current minimum
|
||||||
if numChores < minChores {
|
if int64(numChores) < minChores {
|
||||||
minChores = numChores
|
minChores = int64(numChores)
|
||||||
// set the next assignee to this assignee
|
// set the next assignee to this assignee
|
||||||
nextAssignee = assignee
|
nextAssignee = assignee
|
||||||
}
|
}
|
||||||
|
@ -1119,12 +1119,13 @@ func checkNextAssignee(chore *chModel.Chore, choresHistory []*chModel.ChoreHisto
|
||||||
}
|
}
|
||||||
|
|
||||||
// max Int value
|
// max Int value
|
||||||
minChores := math.MaxInt64
|
var minChores int64 = math.MaxInt64
|
||||||
|
|
||||||
for assignee, numChores := range assigneeChores {
|
for assignee, numChores := range assigneeChores {
|
||||||
// if this is the first assignee or if the number of
|
// if this is the first assignee or if the number of
|
||||||
// chores completed by this assignee is less than the current minimum
|
// chores completed by this assignee is less than the current minimum
|
||||||
if numChores < minChores {
|
if int64(numChores) < minChores {
|
||||||
minChores = numChores
|
minChores = int64(numChores)
|
||||||
// set the next assignee to this assignee
|
// set the next assignee to this assignee
|
||||||
nextAssignee = assignee
|
nextAssignee = assignee
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ func (r *NotificationRepository) GetPendingNotificaiton(c context.Context, lookb
|
||||||
var notifications []*nModel.Notification
|
var notifications []*nModel.Notification
|
||||||
start := time.Now().UTC().Add(-lookback)
|
start := time.Now().UTC().Add(-lookback)
|
||||||
end := time.Now().UTC()
|
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 nil, err
|
||||||
}
|
}
|
||||||
return notifications, nil
|
return notifications, nil
|
||||||
|
|
Loading…
Reference in New Issue