Added some logging to see why postprocessor is not automatically running

This commit is contained in:
rembo10
2014-04-28 15:55:42 -07:00
parent 941da4be1c
commit 54c85c7951
2 changed files with 10 additions and 4 deletions

View File

@@ -1109,6 +1109,7 @@ def start():
SCHED.add_interval_job(versioncheck.checkGithub, minutes=CHECK_GITHUB_INTERVAL)
if DOWNLOAD_SCAN_INTERVAL > 0:
logger.info("download_scan_interval is non-zero - FORTESTING")
SCHED.add_interval_job(postprocessor.checkFolder, minutes=DOWNLOAD_SCAN_INTERVAL)
SCHED.start()

View File

@@ -32,15 +32,17 @@ postprocessor_lock = threading.Lock()
def checkFolder():
logger.info("Checking download folder - FORTESTING")
with postprocessor_lock:
myDB = db.DBConnection()
snatched = myDB.select('SELECT * from snatched WHERE Status="Snatched"')
logger.info("Checking snatched albums - FORTESTING")
for album in snatched:
logger.info("Got an album to check for - FORTESTING")
if album['FolderName']:
logger.info("Album has a foldername: %s - FORTESTING" % album['FolderName'])
if album['Kind'] == 'nzb':
# We're now checking sab config options after sending to determine renaming - but we'll keep the
# iterations in just in case we can't read the config for some reason
@@ -56,7 +58,7 @@ def checkFolder():
nzb_album_path = os.path.join(headphones.DOWNLOAD_DIR, nzb_folder_name).encode(headphones.SYS_ENCODING, 'replace')
if os.path.exists(nzb_album_path):
logger.debug('Found %s in NZB download folder. Verifying....' % album['FolderName'])
logger.info('Found %s in NZB download folder. Verifying....' % album['FolderName'])
verify(album['AlbumID'], nzb_album_path, 'nzb')
if album['Kind'] == 'torrent':
@@ -64,9 +66,12 @@ def checkFolder():
torrent_album_path = os.path.join(headphones.DOWNLOAD_TORRENT_DIR, album['FolderName']).encode(headphones.SYS_ENCODING,'replace')
if os.path.exists(torrent_album_path):
logger.debug('Found %s in torrent download folder. Verifying....' % album['FolderName'])
logger.info('Found %s in torrent download folder. Verifying....' % album['FolderName'])
verify(album['AlbumID'], torrent_album_path, 'torrent')
else:
logger.info("No folder name found for " + album['Title'])
def verify(albumid, albumpath, Kind=None, forced=False):
myDB = db.DBConnection()