fix: deliverytime timestamp error and riderlogs read timeouts
CreateOrder had no fallback for Deliverytime (unlike Orderdate), so it defaulted to "" and Postgres rejected it as an invalid timestamp on every order creation - reproduced and confirmed via a direct manual INSERT. Same fallback pattern as Orderdate now applies. Also carries the v2.7.58 fix that was live but never committed: GetRiderLogsv1 and UpdateRiderLogv1 scope a 15s timeout to their riderlogs full-list LRANGE (900K+ entries, routinely 5-6.5s), instead of the default 3s client timeout that was causing getriderlogs 500s. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -401,6 +401,12 @@ func CreateOrder(c *fiber.Ctx) error {
|
||||
})
|
||||
}
|
||||
|
||||
// ✅ Fallback if deliverytime is missing - it maps to a `timestamp` column,
|
||||
// so an empty string (the zero value) is rejected by Postgres outright.
|
||||
if strings.TrimSpace(data.Deliverytime) == "" {
|
||||
data.Deliverytime = time.Now().Format("2006-01-02 15:04:05")
|
||||
}
|
||||
|
||||
// ✅ Fallback if orderdate is missing
|
||||
if strings.TrimSpace(data.Orderdate) == "" {
|
||||
data.Orderdate = time.Now().Format("2006-01-02 15:04:05")
|
||||
|
||||
Reference in New Issue
Block a user