Comments (3)
when I add a task named 'task600000000' using method 'scheduler.add', the pickled string in redis zset is like this below:
- "ccelery.beat\nScheduleEntry\np0\n(Vtask600000000\np1\nS'app.tasks.task_runner'\np2\ncdatetime\ndatetime\np3\n(S'\x07\xe2\x07\x0c\x0b6\x06\r\x82\xdb'\np4\ntp5\nRp6\nI0\nccelery.schedules\ncrontab\np7\n(S'/30'\np8\nS'1-23'\np9\nS''\np10\nS'1-31'\np11\nS'6-12'\np12\ntp13\nRp14\n(I1\nV600000000\np15\n(I21000001\nI21000012\nI21000013\nI21000015\nI21000014\nI21000020\nI21000018\nI21000019\nI21000021\nI21000022\nI21000023\nI21000024\nI21000025\nI21000026\nI21000027\nI21000028\nI21000029\nI21000030\nI21000031\nI21000032\nI21000033\ntp16\ntp17\n(dp18\n(dp19\ntp20\nRp21\n."
I see the method is implemented as below:
def remove(self, task_key):
self.rdb.zrem(self.key, task_key)
The question is that task_key is not what we put into the zset, so the pickled string above couldn't be removed indeed.
then I tried like this, record the rank of task stored, then remove it using zremrangebyrank command. Am i in the right direct?
def add(self, **kwargs):
e = self.Entry(app=current_app, **kwargs)
self.rdb.zadd(self.key, self._when(e, e.is_due()[1]) or 0, pickle.dumps(e))
rank = self.rdb.zrank(self.key, pickle.dumps(e))
self.rdb.set(kwargs.get("name"), rank)
return True
def remove_by_task_name(self, task_name):
rank = self.rdb.get(task_name)
self.rdb.zremrangebyrank(self.key, rank, rank)
self.rdb.delete(task_name)
from redisbeat.
would you mind show more detail about you code?
i wander what's the type of the app
, function remove
should pass a string type, which means the name of the task such as tasks.add
and it would remove the specified task from celery.
from redisbeat.
remove seems del all task
from redisbeat.
Related Issues (20)
- 请问celery如何动态创建task? HOT 6
- Remote Redis HOT 3
- ImportError: Missing redis library (pip install redis) HOT 12
- redisbeat 1.1.0 does not have the latest changes for python3 HOT 3
- CELERY_REDIS_SCHEDULER_URL with password is not working HOT 2
- Can't see current schedule on INFO HOT 9
- Add a docker-compose demo HOT 8
- Support for redis sentinel HOT 2
- Add support for PeriodicTask tasks
- AttributeError: 'crontab' object has no attribute 'human_seconds' HOT 2
- each time init RedisScheduler - repeated call HOT 2
- 新增task 问题 HOT 1
- [feature] functionality to execute the task as django-celery-beat does: HOT 2
- How to setup an Timzone properly?
- Problematic dependency on jsonpickle==1.2 HOT 2
- 第80行的task为bytes类型 HOT 2
- version 1.2.5 is broken HOT 2
- jsonpickle issues parsing datetime HOT 2
- Hi, I encountered the following error while using this framework. Could you please advise on how to resolve it? My Redis is in cluster mode. HOT 1
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 redisbeat.