Switch poll loop to per-instance dispatched jobs #18
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
PollInstancesCommand::handle()polls instances sequentially within a single command invocation. WithwithoutOverlapping(5)andtimeout(10)per HTTP request, the budget is roughly 50 seconds of slow instances before the 5-minute lock window backs up.For v0.1's expected 1-5 instances this is fine. Beyond ~5 instances, sequential polling becomes a bottleneck (especially if any instance returns slowly).
Goal
Dispatch each instance's poll as a separate queued job. The command becomes a thin dispatcher that fires N jobs and returns immediately. The queue worker handles concurrency.
Acceptance criteria
PollInstancesCommand::handle()dispatches a job per enabled instance instead of calling the action directly.PollFediverseInstanceJob(or similar) wrapsPollFediverseAction::execute($instance).failed()method (Laravel queue convention).routes/console.phpstays the same.PollInstancesCommandTestasserts jobs are dispatched (usingBus::fake()) instead of action invocations.Risks
UrlDiscoveredevents if the action partially succeeds. Decide:tries=1(no retry, lose events on failure) ortries=3with idempotency in #4's listener.Trigger condition
File this when instance count is approaching the v0.1 sequential budget, OR when slow instances are observed causing scheduled lock-window misses.