From d81e289c20f16d4994b4b75b59759638c055e143 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Tue, 9 Apr 2013 10:37:03 +0930 Subject: [PATCH] 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 :) --- autoProcess/autoProcessMovie.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoProcess/autoProcessMovie.py b/autoProcess/autoProcessMovie.py index f6405fc7..515267e7 100644 --- a/autoProcess/autoProcessMovie.py +++ b/autoProcess/autoProcessMovie.py @@ -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