You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Create a new project and add django_cron.autodiscover() to your urls.py
2. Run manage syncdb
3. You get an error saying that the cron table doesn't exist
What is the expected output? What do you see instead?
Personally I would expect autodiscover to fail silently if the tables don't
exist yet.
Original issue reported on code.google.com by [email protected] on 17 Jul 2009 at 10:23
The text was updated successfully, but these errors were encountered:
it was still a problem
autodiscover launch cronScheduler.execute()
so you can have in it database access in it before it creation :
so i changed :
status, created = Cron.objects.get_or_create(pk=1)
# This is important for 2 reasons:
# 1. It keeps us for running more than one instance of the
# same job at a time
# 2. It reduces the number of polling threads because they
# get killed off if they happen to check while another
# one is already executing a job (only occurs with
# multi-threaded servers)
if status.executing:
return
to :
try:
status, created = Cron.objects.get_or_create(pk=1)
# This is important for 2 reasons:
# 1. It keeps us for running more than one instance of the
# same job at a time
# 2. It reduces the number of polling threads because they
# get killed off if they happen to check while another
# one is already executing a job (only occurs with
# multi-threaded servers)
if status.executing:
return
except:
# stop processing because we couldn't read the database
return
Original issue reported on code.google.com by
[email protected]
on 17 Jul 2009 at 10:23The text was updated successfully, but these errors were encountered: