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
Open
feat(rank-tracking): opt-in env toggles to run manual rank checks via the task queue#180redrammedia wants to merge 2 commits into
redrammedia wants to merge 2 commits into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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=queuedroutes manual checks through the existingrunQueuedCheckpath (task_post → task_get polling → live fallback). The decision is resolved inside the durable "prepare" workflow step via a newresolveRankCheckMethod()helper, so it survives workflow replays. The credit pre-check estimates at queued pricing accordingly.RANK_CHECK_QUEUE_LIVE_FALLBACK=offdisables 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.estimateCostand 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.yamlforwards both variables into the self-host container;docs/SELF_HOSTING_CLOUDFLARE.mddocuments them.Testing
resolveRankCheckMethod/resolveQueueLiveFallback(7 cases).pnpm ci:check,pnpm test:ci,pnpm vite buildall pass.🤖 Generated with Claude Code