Skip to content

Commit

Permalink
add timeout to scheduler queue to avoid possible transcoder freeze
Browse files Browse the repository at this point in the history
svn path=/collective.transcode.daemon/trunk/; revision=238837
  • Loading branch information
Dimitris Moraitis committed May 8, 2011
1 parent dc2d737 commit 21d1508
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions collective/transcode/daemon/scheduler.py
Expand Up @@ -117,17 +117,19 @@ def run(self):
print "Scheduler thread running"
self.running = True
while self.running:
job = self.queue.get()
print "New job"
if job is None:
break
if job.UJId not in self.job:
try:
job = self.queue.get(block=True, timeout=5)
except:
continue
if job is None or job.UJId not in self.job:
print "ERROR the job doesn't exist"
continue

print "New job"
url = job.input['url']

ret = 1

try:
print "DOWNLOADING %s" % url
(filename, response) = urllib.urlretrieve(url)
Expand Down

0 comments on commit 21d1508

Please sign in to comment.