updates on the order bulk fix

This commit is contained in:
2026-10-06 17:29:07 +05:30
parent efad4d3d12
commit 7ff9dad288
12 changed files with 1029 additions and 48 deletions

View File

@@ -10,6 +10,7 @@ import (
"doormile/constants"
"doormile/db"
"doormile/internal/assignment"
"doormile/internal/notify"
"doormile/models"
"doormile/utils"
@@ -66,6 +67,12 @@ func MilerStartDuty(c *fiber.Ctx) error {
// location ping. Skipped when the app sent no coordinates.
indexMilerLocation(milerUserID, req.Lat, req.Lon)
// Give the pending orders around them to this rider now, rather than at
// the next periodic sweep (balanced assignment, Phase B).
if req.Lat != 0 && req.Lon != 0 {
go assignment.SweepNear(req.Lat, req.Lon)
}
return utils.OK(c, fiber.Map{
"dutylogid": dutyLog.Dutylogid,
"loginat": dutyLog.Loginat,