Comments (1)
However if the worker just started, last_cleaned_at is None and should_run_maintenance_tasks returns True immediately. This could cause should_run_maintenance_tasks to return True too quickly if workers are short-lived
👉 Why not store last_cleaned_at as a redis key with the worker id as prefix?
I stored this as a local worker attribute so we can eliminate an extra Redis call everytime this is checked (if you have many short lived jobs, workers will perform an extra Redis call everytime they finish). But I think your suggestion is correct, we can also add a Redis key that's shared across all workers.
the maintenance task runs the clean_registries method which takes a lock on queues. However the lock is implemented in a strange way, it's a simple redis key rq:clean_registries:%s with a TTL of 899, but it's never deleted. So the clean_registries cannot run more often than 899 sec, even if the maintenance_interval is smaller
👉 Why not delete the lock once the maintenance task has been done?
The lock should be deleted once maintenance task is finished. Mind opening a PR for this?
from rq.
Related Issues (20)
- How do I log with INFO level from a job?
- no way to catch the redis.exceptions.ConnectionError on pubsub.get_message HOT 4
- Integrating OpenCV with FastAPI and Redis RQ Causes Task/Job Failures HOT 4
- Installing setproctitle >= 1.3.0 breaks RQ on MacOS HOT 1
- Job B depends on job A. A fails. Is there a parameter set that would result in B marked as failed?
- Using `@job` decorator and `func.delay()` causes subclass classmethods to not work correctly HOT 1
- Periodic High CPU with RQ 1.16.1 (not in RQ 1.12.0) HOT 1
- Orphaned "queued" job after shutdown/restart of worker
- [Function Request] Hope to support scheduler cron syntax HOT 3
- [bug] --with-scheduler The scheduled task with the queued name cannot be executed.
- Run Scheduler Immediately Upon `rqworker --with-scheduler` HOT 2
- Error "signal only works in main thread of the main interpreter" after a system failure HOT 1
- The @job decorator is not working as documented
- `import_attribute(...)` in `utils.py` swallows import errors in custom worker classes when running via the CLI. HOT 1
- [feature] WorkerPool with different configuration for queues HOT 2
- Use typing.Protocol to strictly enforce callback function signatures
- How to check why a job is killed? HOT 1
- Admin privileges required to boot RQ Worker
- I tested both long-term and short-term tasks separately, which is very strange
- Worker pool question
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rq.