bring release_status check outside of 2 timer

the release status is changed BEFORE the movie is moved.
For moving of large files, this could see us exit before the rename has completed.
Our main concern is for utorrent to ensure we don't resume seeding while still trying to move files.
In this case, we are concerned with hard-linking only. in which case we can assume we are on the same disk and therefore all file movements should occur within the 2 minute limit.
So, we still wait 2 minutes... But we return a successful result here assuming that large file copies are procceding :)
This commit is contained in:
Clinton Hall 2013-04-09 10:37:03 +09:30
parent 3b076a5cfa
commit d81e289c20

View file

@ -323,10 +323,11 @@ def process(dirName, nzbName=None, status=0, clientAgent = "manual", download_id
if movie_status != initial_status: # Something has changed. CPS must have processed this movie.
Logger.info("SUCCESS: This movie is now marked as status %s in CouchPotatoServer", movie_status)
return 0 # success
time.sleep(20) # Just stop this looping infinitely and hogging resources for 2 minutes ;)
else:
if release_status != initial_release_status and release_status != "none": # Something has changed. CPS must have processed this movie.
Logger.info("SUCCESS: This release is now marked as status %s in CouchPotatoServer", release_status)
return 0 # success
time.sleep(20) # Just stop this looping infinitely and hogging resources for 2 minutes ;)
else: # The status hasn't changed. we have waited 2 minutes which is more than enough. uTorrent can resule seeding now.
else: # The status hasn't changed. we have waited 2 minutes which is more than enough. uTorrent can resule seeding now.
Logger.warning("The movie does not appear to have changed status after 2 minutes. Please check CouchPotato Logs")
return 1 # failure