Hi Henrik. On Mar 7, 10:47 pm, "Henrik Lied" <[EMAIL PROTECTED]> wrote: > So I've been thinking about a queue-system. How I should do this I'm > not sure about. I was thinking about adding an extra field to the > model (encoded = models.BooleanField), and setup a python script which > returns all the non-encoded entries. This script then executes the > os.system()-command, and sets encoded to True. > I guess I'd have to setup a simple crontab that would run this script > every 10-20 minute.
I think you're on the right track with this. I have used a similar approach in a few situations. I think it is much more robust to add a record to a queue and have a separate process do the long running tasks. The interface can then check the queue and display the status of the tasks. It's more robust in that if you servers have a high load and it takes 5 minutes to encode the video, you don't have to worry about the http request timing out. Instead, the user can see their video is "processing" and continue with other things. If it fails to convert the video for some reason, you can show it as "failed" and maybe give a "try again" option. If you expect conversion will normally be fast, you can show the user a progress indicator and use an Ajax call to poll the server and update the display when it's done. Scott --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---