Skip to content

feat: fleet arrival queue (rebase of #1413 onto main)#1508

Closed
tiweb442 wants to merge 14 commits into
lanedirt:mainfrom
tiweb442:feature/363-fleet-queue-rebased
Closed

feat: fleet arrival queue (rebase of #1413 onto main)#1508
tiweb442 wants to merge 14 commits into
lanedirt:mainfrom
tiweb442:feature/363-fleet-queue-rebased

Conversation

@tiweb442

Copy link
Copy Markdown
Contributor

Summary

This is a clean rebase/merge of #1413 onto current main, plus a small hardening commit. Credit for the feature work belongs to @Geda173.

#1413 implements real-time fleet arrival processing for #363 and supersedes the stalled Redis approach in #817. It was ~19 commits behind main; this branch merges cleanly with no conflicts.

Included on top of #1413

  • Align ProcessFleetArrival timeout and destination lock TTL to 600s
  • More lock-contention retries (tries 10)
  • Queue worker --sleep=0.5 --timeout=600 for snappier delayed arrivals

See also hardening PR against Geda173's branch: Geda173#68

Smoke test results (local Docker, this branch)

Suite Result
FleetArrivalQueueTest 7 passed (84 assertions)
FleetDispatchMultiDefenderBattleTest 8 passed (117 assertions)
Migration add_fleet_arrival_queue_fields... applied OK
ogamex:scheduler:process-fleet-arrivals runs OK

Related

Test plan

  • FleetArrivalQueueTest
  • FleetDispatchMultiDefenderBattleTest
  • Manual preview: simultaneous arrivals, recall, restart with in-flight missions
  • Confirm queue worker uses fleet-arrivals queue after deploy

Made with Cursor

Geda173 and others added 14 commits May 26, 2026 15:14
…ing, scheduler fallback

  - Add time_arrival_ms (bigint) to fleet_missions for sub-second ordering
  - Dispatch a delayed ProcessFleetArrival job at fleet send via FleetMissionObserver
  - Serialize same-destination processing with Cache::lock; different destinations run concurrently
  - Order same-destination arrivals by time_arrival / time_arrival_ms / id
  - ACS Defend gets a second hold_job_id job firing at physical arrival time
  - Cancel pending jobs on recall by tracking arrival_job_id / hold_job_id on the mission
  - Add ProcessFleetArrivals scheduler command (every minute) as fallback after downtime
  - Reuse existing DB queue jobs in syncMissionArrivalJobs when timing is unchanged
  - Assert database queue driver at boot; other drivers cannot track job IDs for cancellation
  - Wrap processDueMissionEventsForMission in DB::transaction for atomic batch rollback
  - Fix migration missing trailing semicolon on anonymous class
Raise ProcessFleetArrival timeout and destination lock TTL to 600s so
large battles are not killed mid-lock, allow more lock-contention retries,
and poll the queue every 0.5s for snappier delayed arrivals.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

Preview deployment

Status URL Commit
❌ Destroyed pr-1508.preview.ogamex.dev -

Preview environment has been cleaned up.

@Geda173

Geda173 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

I have pushed a number of changes to my branch, which this PR is based on. Closing in favor of #1413.

@Geda173 Geda173 closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement worker queue / cron system to chronologically process fleet missions

2 participants