tejasjadhav / django-scheduler Goto Github PK
View Code? Open in Web Editor NEWDjango app for scheduling tasks
License: GNU General Public License v3.0
Django app for scheduling tasks
License: GNU General Public License v3.0
I've got a celery worker running with RabbitMQ and have been able to test with celery-beat that the tasks will run using periodic tasks and intervals as well as crontabs. I don't want to use those because rrule is so much nicer.
The Task is being created as far as I can tell in the database.
task_id = TaskScheduler.schedule(say_hello, description="finally", rrule_string='RRULE:FREQ=HOURLY;INTERVAL=2')
And here's the task:
@shared_task(base=RepeatTask, name='say_hello')
def say_hello():
print("sayingHello")
Any ideas why this might not be picking it up?
Currently, args
and kwargs
of the scheduled tasks are stored in JSONField
which has support only for PostgreSQL databases.
We can use a TextField
instead and use json.loads
and json.dumps
to fetch and store the function arguments respectively.
It would be much convenient to change the scheduled date and time of an already scheduled task. This means, if a task is about to run at a specified date and time, then there should be some way to change this and schedule it at some other time. It can be preponed or postponed.
Also, changing the recurrence rule would affect all the subsequent runs and the updated recurrence rule would be in effect.
I need to add a set of exhaustive test cases for this library. Test cases should cover only library specific edge cases.
The current logic for calculating the next ETA is not a clean solution. To calculate the next ETA, it runs the recurrence rule from start, iterates every single outcome and then matches the one which is greater than the current ETA.
This might not be a big problem if the intervals are very long. For example, if the interval is one month, and we want to calculate the next ETA after 6 months, then there would be 6 iterations before getting the right ETA.
However, if the interval is small (one second) and now if we want to calculate next ETA after 6 months, then there would be 60 (seconds) * 60 (minutes) * 24 (hours) * 30 (days) * 6 (months) = 15552000 iterations! This is very inefficient.
I think we can re-implement custom recurrence rule sequence generator which efficiently calculates the next ETA (using mathematics, maybe ๐). This might free us from dependency on dateutil (nothing against the library, it's awesome!).
Need to add a basic setup and installation guide in the README which includes,
pip
installation.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.