Skip to content

feat(rank-tracking): opt-in env toggles to run manual rank checks via the task queue - #180

Open
redrammedia wants to merge 2 commits into
every-app:mainfrom
redrammedia:feat/queued-manual-rank-checks
Open

feat(rank-tracking): opt-in env toggles to run manual rank checks via the task queue#180
redrammedia wants to merge 2 commits into
every-app:mainfrom
redrammedia:feat/queued-manual-rank-checks

Conversation

@redrammedia

Copy link
Copy Markdown

Motivation

Scheduled rank checks already use DataForSEO's standard task queue (~30% of the live endpoint's cost), but manual "Check now" runs always pay live prices. For self-hosters who track a few hundred keywords and don't mind waiting a few minutes, that's a ~3.3x cost difference with identical data — both paths send the same request parameters and parse results through the same buildRankCheckResult.

This PR adds two opt-in env toggles so self-hosters can choose cost over speed. Default behavior is completely unchanged — without the variables set, every code path resolves to today's behavior.

Changes

RANK_CHECK_MANUAL_METHOD=queued routes manual checks through the existing runQueuedCheck path (task_post → task_get polling → live fallback). The decision is resolved inside the durable "prepare" workflow step via a new resolveRankCheckMethod() helper, so it survives workflow replays. The credit pre-check estimates at queued pricing accordingly.

RANK_CHECK_QUEUE_LIVE_FALLBACK=off disables the live fallback for queued stragglers (some self-hosters prefer "never bill live prices" over completeness). To compensate, the polling window extends from ~15 minutes to ~2¼ hours (cumulative waits 4/6/8/10/12/15/30/45/60/75/105/135 min). Anything still missing afterwards is reported by the existing finalize logic as "could not be checked" instead of being re-billed live.

Cost estimate follows the resolved method: RankTrackingService.estimateCost and the check-confirm dialog show queued pricing and realistic timing ("~5-15 min (task queue)") when the toggle is active, live pricing otherwise. Saving config edits now also invalidates the cached cost estimate so the header price updates without a reload (a small pre-existing staleness bug that also affects the default setup).

compose.yaml forwards both variables into the self-host container; docs/SELF_HOSTING_CLOUDFLARE.md documents them.

Testing

  • New unit tests for resolveRankCheckMethod / resolveQueueLiveFallback (7 cases).
  • pnpm ci:check, pnpm test:ci, pnpm vite build all pass.
  • Verified end-to-end on a self-hosted Docker install: with the toggles set, a manual 140-keyword check ran fully through the queue (140 posted, 140 collected, 0 live fallbacks, ~6 min) at queued cost; without the variables, behavior is byte-identical to main.

🤖 Generated with Claude Code

redrammedia and others added 2 commits July 30, 2026 14:46
…llback opt-out

RANK_CHECK_MANUAL_METHOD=queued routes manual rank checks through
DataForSEO's standard task queue (~30% of live cost).
RANK_CHECK_QUEUE_LIVE_FALLBACK=off disables the live fallback for queued
stragglers and extends queue polling to ~2 hours instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…efreshes after config edits

estimateCost resolves the manual check method instead of hardcoding live
pricing, the check-confirm dialog shows the matching price and queue
timing, and saving config edits invalidates the cached cost estimate so
the header price updates without a reload.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
HasimEmre pushed a commit to HasimEmre/open-seo that referenced this pull request Jul 30, 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.

1 participant