i'd like to talk about this sometime. all the import options are a bit
mysterious to me...
John Bass
ITng Services
(919) 515-0154
On Thu, Apr 15, 2010 at 7:13 AM, Brian Bouterse <bmbouter(a)gmail.com> wrote:
Here is an example of a problem that comes from using import blah
instead
of from blah import x. If it isn't obvious what these folks are talking
about we can talk more on the list or in person. Just some food for thought
I wanted to share.
Best,
Brian
---------- Forwarded message ----------
From: Wes Winham <winhamwr(a)gmail.com>
Date: Wed, Apr 14, 2010 at 10:45 AM
Subject: [celery-users] Re: Tasks being executed twice
To: celery-users <celery-users(a)googlegroups.com>
I was actually having this exact same problem. It was precipitated by
my sloppy path management I think. When I started the project in
question, my understanding of python was pretty limited, so I had put
both my django project directory and the directory above my project on
the python path, which meant all of my apps were addressable as both
project.appname and appname. I then proceeded to be inconsistent about
which path I used when I imported different things, which lead to a
general mess of this class of problem.
Anyway, I tried to clean up my code, but I still haven't eliminated
all of the "import appname" style references, which was causing me to
duplicate all of the tasks contained in apps inside my project
directory. I upgraded to 1.0.2 yesterday though, and the problem has
somehow disappeared. I'm not 100% convinced that it was just the
upgrade that fixed it, as I changed some other code in the interim,
but it's definitely the most likely candidate. One thing I'm doing
that might be different is that I'm explicitly registering all of my
tasks still (after an upgrade from 0.something => 0.8 => 1.02) using
celery.registry.tasks.register(MyTask).
-wes
On Apr 14, 6:25 am, Rickard Böttcher <rickard.bottc...(a)gmail.com>
wrote:
> Hi, I use celery in a django project. I have an issue where my tasks
> are being
> loaded/scheduled/executed twice for each task, once for
> projectname.appname.tasks.taskname and once for
> appname.tasks.taskname.
>
> Using RabbitMQ v1.7.2, celery 1.0.1.
>
> The log from celeryd shows the tasks being loaded twice as well as
> executed twice:
> (check_status task is a periodic task)
>
> Configuration ->
> . broker -> amqp://projectname@localhost:5672/projectname
> . queues ->
> . celery -> exchange:celery (direct) binding:celery
> . concurrency -> 1
> . loader -> celery.loaders.djangoapp.Loader
> . logfile -> [stderr]@INFO
> . events -> OFF
> . beat -> ON
> . tasks ->
> . projectname.appname.tasks.check_status
> . appname.tasks.check_status
>
> [2010-04-14 11:42:31,006: INFO/PoolWorker-2] child process calling
> self.run()
> celery@localhost has started.
> [2010-04-14 11:42:31,015: INFO/_Process-1] child process calling
> self.run()
> [2010-04-14 11:42:31,017: INFO/_Process-1] ClockService: Starting...
> [2010-04-14 11:47:00,018: INFO/MainProcess] Got task from broker:
> projectname.appname.tasks.check_status[811eeb14-3437-4a0a-
> bcd2-221ed52ba2d6]
> [2010-04-14 11:47:00,030: INFO/MainProcess] Got task from broker:
> appname.tasks.check_status[fccbeb3d-d0ee-47d0-a8eb-8dfe905061e9]
> [2010-04-14 11:47:00,131: INFO/PoolWorker-2] check_status()
> [2010-04-14 11:47:00,614: INFO/PoolWorker-2] check_status()
> [2010-04-14 11:47:00,614: INFO/MainProcess] Task
> appname.tasks.check_status[fccbeb3d-d0ee-47d0-a8eb-8dfe905061e9]
> processed: None
> [2010-04-14 11:47:01,083: INFO/MainProcess] Task
> projectname.appname.tasks.check_status[811eeb14-3437-4a0a-
> bcd2-221ed52ba2d6] processed: None
>
> Any ideas what might cause this behavior?
>
> /Rickard
--
You received this message because you are subscribed to the Google Groups
"celery-users" group.
To post to this group, send email to celery-users(a)googlegroups.com.
To unsubscribe from this group, send email to
celery-users+unsubscribe@googlegroups.com<celery-users%2Bunsubscribe(a)googlegroups.com>
.
For more options, visit this group at
http://groups.google.com/group/celery-users?hl=en.
--
Brian Bouterse
ITng Services
_______________________________________________
Opus-devel mailing list
Opus-devel(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/opus-devel