On 9 Oct 2012, at 16:50, Recif Deregle <
leger.f...@gmail.com> wrote:
> Hi all,
>
> I work in a company who is giving a try to celery. So far its seems exactly what we need
> but i have pb configuring it to use a mysql backend for both broker & results.
>
> i know this is not the privileged way but we already have to integrate with an existent solution
>
> does an expert can give me a hand to have this working ?
>
> can't find any ref to the error i am having or any tutos for using it with mysql.
> CELERY_RESULT_BACKEND = "database"
> CELERY_RESULT_DBURI = "sqla+mysql://dbuser:dbpass@dbhost/celery"
The RESULT_DBURI setting is always a SQLAlchemy connection url so shouldn't
have the 'sqla+' prefix:
CELERY_RESULT_DBURI = "mysql://dbuser:dbpass@dbhost/celery"
AFAIR the sqlalchemy broker transport has a serious flaw in that
it never removes any messages. I fixed the Django transport to clean up
messages from time to time, but the sqla transport has not been updated yet.
If you are dedicated to using sqla this shouldn't be too hard to implement,
you can look at the Django transport to see how I did it there:
https://github.com/celery/kombu/blob/master/kombu/transport/django/managers.py#L50-78
Or you can just add a periodic task to delete rows from the Message table with
the visible flag set.
The implementation of both is rather rudimentary since I don't have time
to maintain them, but it shouldn't take much work to make much better.
--
Ask Solem
twitter.com/asksol |
+44 (0)7713357179