Update: 2026-07-10 03:04:06
This commit is contained in:
@@ -313,6 +313,17 @@ try {
|
||||
// ✅ Payment succeeded — COMMIT
|
||||
$con->commit();
|
||||
|
||||
// 🆕 Cache ride state in Redis — placed immediately after commit(), before
|
||||
// the best-effort remote-DB sync / streak / notification code below, so a
|
||||
// later exception in any of those non-critical steps can never suppress
|
||||
// this write for a ride that's genuinely finished in MySQL.
|
||||
sendToLocationServer('update_ride_state', [
|
||||
'ride_id' => $rideId,
|
||||
'status' => $newStatus,
|
||||
'driver_id' => $driver_id,
|
||||
'passenger_id' => $passengerId,
|
||||
]);
|
||||
|
||||
// 🔥 [Fix Split-Brain] تحديث القاعدة البعيدة الآن فقط، بعد أن أصبح الدفع
|
||||
// والتحديث المحلي مؤكدَين نجاحهما — يبقي الحالتين متطابقتين دائماً.
|
||||
// فشل هذا التحديث best-effort فقط (لا يُرجع الرحلة المحلية المُنجَزة فعلاً).
|
||||
|
||||
Reference in New Issue
Block a user