should be using celery.
Celery includes something called periodic tasks.
http://ask.github.com/celery/userguide/periodic-tasks.html
You just need to make a task that updates the value in cache, and then
set it to run with a schedule=timedelta(minutes=3) (or schedule=60*3).
Hope that helps!
Alex
On Mar 1, 9:10 am, Helgi Borg <helgib...@gmail.com> wrote:
> I need my Django app to poll data in DB regularly (say once every 3
> minutes) and cache the data. I have some queries that take up to 20
> sec. The users must never wait this long for response from my app.
> What is the must natural way to go about this in Django?
>
> I know that I can use memcache, but that way the users will once in
> while have to wait a long time while the cache is being refreshed.
>
> Best regards,
> Helgi Borg
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment