Comments (8)
Have you something that keeps the background tasks up and running according to the README (see https://github.com/arteria/django-background-tasks#running-tasks)?
from django-background-tasks.
yes, I followed the README.
I tried to solve this problem today, with python manage.py process_tasks -v 3 --log-level=DEBUG
. what I discovered is when django-background-tasks query for the tasks from database, it found no task. But in fact, all the tasks are stored in database.
I execute the query clause in my db console. the result shows all my tasks, this means the query is correct, but django-background-tasks find no task.
The following is the query clause:
QUERY = u'SELECT "background_task"."id", "background_task"."task_name", "background_task"."task_params", "background_task"."task_hash", "background_task"."priority", "background_task"."run_at", "background_task"."queue", "background_task"."attempts", "background_task"."failed_at", "background_task"."last_error", "background_task"."locked_by", "background_task"."locked_at" FROM "background_task" WHERE (("background_task"."locked_by" IS NULL OR "background_task"."locked_at" < %s) AND "background_task"."failed_at" IS NULL AND "background_task"."run_at" <= %s) ORDER BY "background_task"."priority" DESC, "background_task"."run_at" ASC' - PARAMS = (u'2016-07-11 14:37:59.072193', u'2016-07-11 15:37:59.072193'); args=(u'2016-07-11 14:37:59.072193', u'2016-07-11 15:37:59.072193')
after this query, it prints debug message
DEBUG:root:waiting for tasks
and then repeat this status again and again...
By the way, I'm using postgresql. Thank you very much.
from django-background-tasks.
What happens if you call python manage.py process_tasks
in the production (virtual) env?
Basically 2 tasks must be running
- 1 for processing requests and
- 1 to process the tasks in the queue.
from django-background-tasks.
I'm not quite understand what you said "2 tasks", you mean 2 process?
What I said above is on my production env, the background tasks works fine with my develop env.
When i call python manage.py process_tasks
, it shows nothing in the console.
And when i checking the running process, I only find one running process
zhaochy 24639 24616 0 00:26 pts/21 00:00:01 python ./manage.py process_tasks
from django-background-tasks.
Yes, you're right – two processes, not two tasks.
from django-background-tasks.
@zhaochy1990 could you manage to make it work? Please close the filed issue in this case or provide more information about your setup, settings, source, ..
Thank you.
from django-background-tasks.
Hi I'm running into the same issue stated by @zhaochy1990.
Tasks are being created correctly in the background_tasks
table but when I run python manage.py process_tasks
they are actually processed on dev environment only, while they are not processed in the production env (though by debugging, the generated SQL queries result in being correct).
I also see only one running process:
1055 11152 0.0 0.1 287480 42952 pts/2 S+ 09:19 0:02 python2.7 manage.py process_tasks
@zhaochy1990 how did you solve the problem? Thanks in advance.
from django-background-tasks.
I use celery instead
from django-background-tasks.
Related Issues (20)
- django.db.migrations.exceptions.NodeNotFoundError
- Tasks not found when app is configured using confg class HOT 2
- Async Background still runs tasks linearly instead of Parallel HOT 2
- Run tasks individually
- best way to start repeating tasks and question about failing
- manage.py process_tasks not picking tasks w Django 3.2 HOT 2
- What happens if I add multiple process_tasks workers?
- BACKGROUND_TASK_RUN_ASYNC = True not working
- Not supported in Django 4.0 HOT 4
- Repeatedly get 'Failed to retrieve tasks. Database unreachable.' error message.
- Change "has error" to "successful" for UI
- Tasks Run Multiple Times because of Error
- Add individual `max_run_time`option at task level.
- Is this project still maintained? HOT 3
- Do I need to run process_tasks to start tasks? HOT 3
- Does django background tasks slow down my site? HOT 1
- ModuleNotFoundError: No module named 'background-task'
- Background task running twice. HOT 2
- CHANGE DEFAULT DB CONNECTION
- How can I detect the task errors?
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 django-background-tasks.