updates on the order bulk fix
This commit is contained in:
@@ -120,6 +120,10 @@ func sweepOnce(interval time.Duration) {
|
||||
}
|
||||
}
|
||||
|
||||
// Orders a rider never accepted go back to the pool first, so this same
|
||||
// sweep can hand them to someone else.
|
||||
releaseUnaccepted()
|
||||
|
||||
pending, err := pendingForSweep(time.Now())
|
||||
if err != nil {
|
||||
utils.Error("PendingSweeper: could not list pending bookings", "error", err)
|
||||
@@ -151,7 +155,7 @@ func sweepOnce(interval time.Duration) {
|
||||
// ExpressDispatchAgent owns them.
|
||||
func pendingForSweep(now time.Time) ([]models.PickupBooking, error) {
|
||||
q := db.DB.Model(&models.PickupBooking{}).
|
||||
Select("bookingid", "bookingsource").
|
||||
Select("bookingid", "bookingsource", "pickuplatitude", "pickuplongitude").
|
||||
Where("status = ? AND assignedmileruserid IS NULL", constants.BookingPendingPickup).
|
||||
Where("pickuplatitude <> 0 AND pickuplongitude <> 0").
|
||||
Where("createdat <= ? AND createdat >= ?", now.Add(-sweepMinAge), now.Add(-sweepMaxAge()))
|
||||
|
||||
Reference in New Issue
Block a user