duangenquan / django-cron

Automatically exported from code.google.com/p/django-cron
MIT License
0 stars 0 forks source link

returned more than one Job ( cronScheduler.register(TimedRotatingFile) only one) #18

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. normal
2. May be related to
3. The cache backend to use. 
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1] ServerName:
'www.template.me', referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1] DocumentRoot:
'/htdocs', referer: http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1] URI:
'/static/skins/090425/images/head_bg.gif', referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1] Location: None,
referer: http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1] Directory: None,
referer: http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1] Filename: '/htdocs',
referer: http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1] PathInfo:
'/static/skins/090425/images/head_bg.gif', referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1] Traceback (most
recent call last):, referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in
HandlerDispatch\n    default=default_handler, arg=req,
silent=hlist.silent), referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1229, in
_process_target\n    result = _execute_target(config, req, object, arg),
referer: http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1128, in
_execute_target\n    result = object(arg), referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/var/lib/python-support/python2.5/django/core/handlers/modpython.py", line
228, in handler\n    return ModPythonHandler()(req), referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/var/lib/python-support/python2.5/django/core/handlers/modpython.py", line
201, in __call__\n    response = self.get_response(request), referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/var/lib/python-support/python2.5/django/core/handlers/base.py", line 67,
in get_response\n    response = middleware_method(request), referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/var/lib/python-support/python2.5/django/middleware/common.py", line 56,
in process_request\n    if (not _is_valid_path(request.path_info) and,
referer: http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/var/lib/python-support/python2.5/django/middleware/common.py", line 142,
in _is_valid_path\n    urlresolvers.resolve(path), referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/var/lib/python-support/python2.5/django/core/urlresolvers.py", line 246,
in resolve\n    return get_resolver(urlconf).resolve(path), referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/var/lib/python-support/python2.5/django/core/urlresolvers.py", line 179,
in resolve\n    for pattern in self.urlconf_module.urlpatterns:, referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/var/lib/python-support/python2.5/django/core/urlresolvers.py", line 198,
in _get_urlconf_module\n    self._urlconf_module =
__import__(self.urlconf_name, {}, {}, ['']), referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/home/jane/workspace/template.me/www/src/org/../org/urls.py", line 10, in
<module>, referer: http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/home/jane/workspace/template.me/www/src/org/lib/mods-enabled/django_cron/__ini
t__.py",
line 60, in autodiscover, referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/home/free/workspace/template.me/www/src/org/handler/cron.py", line 45, in
<module>\n    cronScheduler.register(TimedRotatingFile), referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/home/jane/workspace/template.me/www/src/org/lib/mods-enabled/django_cron/base.
py",
line 77, in register, referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/var/lib/python-support/python2.5/django/db/models/manager.py", line 96,
in get_or_create\n    return self.get_query_set().get_or_create(**kwargs),
referer: http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/var/lib/python-support/python2.5/django/db/models/query.py", line 332, in
get_or_create\n    return self.get(**kwargs), False, referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]   File
"/var/lib/python-support/python2.5/django/db/models/query.py", line 311, in
get\n    % (self.model._meta.object_name, num, kwargs)), referer:
http://localhost:8005/static/skins/090425/style/style.css
[Tue Jul 21 10:14:54 2009] [error] [client 127.0.0.1]
MultipleObjectsReturned: get() returned more than one Job -- it returned 3!
Lookup parameters were {'name': "<class
'org.handler.cron.TimedRotatingFile'>"}, referer:
http://localhost:8005/static/skins/090425/style/style.css

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by gnu...@gmail.com on 21 Jul 2009 at 2:58

GoogleCodeExporter commented 8 years ago
if change "run_every" value ,get more than one Job 

Original comment by gnu...@gmail.com on 22 Jul 2009 at 3:37

GoogleCodeExporter commented 8 years ago
ah - good find! did you also find a solution? Obviously you can manually delete 
the
app from the database, but it would be preferrable to do a get_or_create, which 
does
not include the "run_every" and just update the "run_every" attribute when it 
is changed

Original comment by Jim.mixt...@gmail.com on 27 Oct 2009 at 4:42