Background task account filter table

May 22, 2026 · View on GitHub

Below we only look at "where to filter what status" to facilitate local troubleshooting.

TasksFilter LocationsFilter ConditionsSkipped Status/ResultsDescription
Usage polling threadcrates/service/src/usage/refresh/batch.rsstatus = disabled, and the latest event hit a ban or refresh-blocked reasondisabled, account_deactivated, workspace_deactivated, refresh_token_region_blockedPut these accounts into skipped_ids first, and then filter them out from the token list
Gateway keep-alive threadcrates/core/src/storage/accounts.rsstatus = active, and meet the gateway availability conditionsAccounts other than active will not enter the candidate set directlyInstead of traversing all accounts, candidate accounts will be screened first and then kept alive
Token refresh pollingcrates/core/src/storage/tokens.rsrefresh_token cannot be empty; the latest status cannot be a deactivated class reason or refresh_token_region_blockedNone refresh_token, account_deactivated, workspace_deactivated, refresh_token_region_blockedOnly process tokens that can be refreshed and are not paused; after fixing the proxy route, manually restoring the account makes it eligible again

Supplement

PhenomenonCommon causes
It seems "available one second, expired the next second"The server will not return until the next refresh refresh_token_expired
There is no action for gateway keepaliveThe candidate account is empty, or there is no active available account
No movement in usage pollingThe accounts have been filtered out, or there are no accounts that can be processed in the current batch

Shortest conclusion

Both 用量轮询 and 令牌刷新 will filter accounts by status; 网关保活 only recognizes candidate accounts from active.