Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce Twitter token lock time from 24h to 1h for better service recovery #17580

Open
1 task done
AiraNadih opened this issue Nov 14, 2024 · 2 comments
Open
1 task done
Labels
RSS bug Something isn't working

Comments

@AiraNadih
Copy link
Contributor

AiraNadih commented Nov 14, 2024

Routes

/twitter/home/:routeParams?

Full routes

/twitter/home/onlyMedia=1

Related documentation

https://docs.rsshub.app/routes/social-media#x-twitter

What is expected?

When a Twitter token becomes invalid and login retry fails, the token should be locked for a reasonable time period (e.g., 1 hour).

What is actually happening?

Currently, when a token becomes invalid (403/401 response) and login retry fails, the code locks the token for 86400 seconds (24 hours). This is unnecessarily long and could cause extended service disruption even after the credentials are fixed.

Relevant code:

await cache.set(`${lockPrefix}${auth.token}`, '1', 86400);

Deployment information

Self-hosted

Deployment information (for self-hosted)

No response

Additional info

Suggested changes:
1. Reduce the lock time from 86400 (24 hours) to 3600 (1 hour)
2. This shorter duration would:
   - Allow faster recovery after credential fixes
   - Improve service availability

This is not a duplicated issue

  • I have searched existing issues to ensure this bug has not already been reported
@AiraNadih AiraNadih added the RSS bug Something isn't working label Nov 14, 2024

This comment was marked as duplicate.

@github-actions github-actions bot reopened this Nov 14, 2024
Copy link
Contributor

Searching for maintainers:

To maintainers: if you are not willing to be disturbed, list your username in scripts/workflow/test-issue/call-maintainer.js. In this way, your username will be wrapped in an inline code block when tagged so you will not be notified.

If all routes can not be found, the issue will be closed automatically. Please use NOROUTE for a route-irrelevant issue or leave a comment if it is a mistake.
如果所有路由都无法匹配,issue 将会被自动关闭。如果 issue 和路由无关,请使用 NOROUTE 关键词,或者留下评论。我们会重新审核。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RSS bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant