xaralis / django-static-sitemaps

Tool for generating sitemaps as static files to serve them from webserver instead of your Django application.
153 stars 73 forks source link

STATICSITEMAPS_REFRESH_AFTER = None seems not to be working #71

Closed pasevin closed 4 years ago

pasevin commented 5 years ago

I'm not sure if I'm doing something wrong, but if I set:

STATICSITEMAPS_REFRESH_AFTER = None

Celery still attempts at running it:

[2019-09-19 22:01:16,571: ERROR/MainProcess] Received unregistered task of type 'static_sitemaps.tasks.GenerateSitemap'.
The message has been ignored and discarded.

Did you remember to import the module containing this task?
Or maybe you're using relative imports?

Please see
http://docs.celeryq.org/en/latest/internals/protocol.html
for more information.

The full contents of the message body was:
b'[[], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]' (77b)
KeyError: 'static_sitemaps.tasks.GenerateSitemap'
skulegirl commented 4 years ago

I had this problem too until I remembered that I use django-celery-beat to store my list of periodic tasks in my database, and the static_sitemaps.tasks.GenerateSitemap tasks was still there. Once I removed that entry, problem solved.

pasevin commented 4 years ago

haha thanks @skulegirl I totally forgot that. I assumed it will be cleaned by setting STATICSITEMAPS_REFRESH_AFTER to None