Friday, August 16, 2013

Django Periodic tasks

I'm aware of django-cron and django-celery, both of which are capable of
doing what I want but I was wondering if I was just making a fundamental
design mistake and there maybe a better option that someone here could
explain.

Basically customers pay money into their account in advance so that they
can use services that we offer. Each service is charged by the minute
and prices between services can vary wildly. I need to be able to show
our clients their current running total to the nearest hour so that they
know when they need to add extra funds to their account.

My initial thought was that I would just have the equivalent of a cron
job running every hour that queries the database for the state of each
users application and then used that to produce an estimate for their
current billing.

Alternately I could get rid of the hourly period task and just work it
out when a customer visits a certain page but that is likely to lead to
long load times and heavy database use.

Any suggestions on what you would do in this situation?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate