Skip to content
Browse files

sleeps only between the fenceposts

  • Loading branch information...
1 parent 345f56b commit 5147860a48c979f92d55df29bc43b6337aa56380 @CarlFK committed
Showing with 9 additions and 5 deletions.
  1. +2 −0 TODO.txt
  2. +7 −5 dj/scripts/process.py
View
2 TODO.txt
@@ -36,6 +36,8 @@ veyepar:
upload category - needs default
upload to youtube
+ use testing server for testing
+ https://developers.google.com/youtube/2.0/developers_guide_protocol_testing
delete old when replaced by new encode.
upload in draft state:
View
12 dj/scripts/process.py
@@ -169,6 +169,7 @@ def process_ep(self, episode):
def process_eps(self, episodes):
ret = None
+ sleepytime=False
for e in episodes:
# next line requires the db to make sure the lock field is fresh
ep=Episode.objects.get(pk=e.id)
@@ -195,17 +196,18 @@ def process_eps(self, episodes):
if self.options.verbose: print ep.name
if self.options.lag:
- if ep != episodes[0]: # don't lag on the first one.
- # this is at the top of the loop because
- # we can cleanly detect the first,
- # but no the last
- # and we only want to lag between the fence posts.
+ if sleepytime:
+ # don't lag on the first one that needs processing,
+ # we only want to lag between the fence posts.
print "lagging....", self.options.lag
time.sleep(self.options.lag)
+ else:
+ sleepytime = True
self.log_in(ep)
ret = self.process_ep(ep)
if self.options.verbose: print "process_ep:", ret
+
# .process is long running (maybe, like encode or post)
# so refresh episode in case its .stop was set
# (would be set in some other process, like the UI)

0 comments on commit 5147860

Please sign in to comment.
Something went wrong with that request. Please try again.