comment out sleep again, also removed some debugs, and converted some to AddLogForJob

This commit is contained in:
2021-01-18 13:20:15 +11:00
parent 3951b3e0a1
commit 4053919def

View File

@@ -59,6 +59,7 @@ class FileData():
tags = exifread.process_file(f)
except:
print('NO EXIF TAGS?!?!?!?')
AddLogForJob(job, "WARNING: No EXIF TAF found for: {}".format(file))
f.close()
raise
f.close()
@@ -128,7 +129,7 @@ class FileData():
paths = settings.import_path.split("#")
for path in paths:
print( "GenerateFileData: Checking {}".format( path ) )
AddLogForJob(job, "Checking Import Directory: {}".format( path ) )
path = self.FixPath(path)
if os.path.exists( path ):
# to serve static content of the images, we create a symlink
@@ -145,7 +146,7 @@ class FileData():
fname=file.replace(path, "")
stat = os.stat(file)
if last_import_date == 0 or stat.st_ctime > last_import_date:
print( "{} - {} is newer than {}".format( file, stat.st_ctime, last_import_date ) )
AddLogForJob(job, "DEBUG: {} - {} is newer than {}".format( file, stat.st_ctime, last_import_date ) )
fthumbnail = None
if os.path.isdir(file):
ftype = 'Directory'
@@ -172,7 +173,7 @@ class FileData():
else:
AddLogForJob(job, "DEBUG: {} - {} is OLDER than {}".format( file, stat.st_ctime, last_import_date ), file )
# include this for making the job be a bit slower, and # allowing testing of active jobs/job refresh page, etc.
# time.sleep(0.4)
#time.sleep(0.4)
settings.last_import_date = time.time()
session.commit()
return self
@@ -273,7 +274,6 @@ def InitialiseManager():
global pa_eng
pa_eng=session.query(PA_JobManager).first()
print(pa_eng)
if( pa_eng == None ):
pa_eng = PA_JobManager(state='Initialising', num_active_jobs=0, num_completed_jobs=0 )
session.add(pa_eng)
@@ -288,7 +288,6 @@ def AddLogForJob(job, message, current_file=''):
session.commit()
def RunJob(job):
print("Run job: {}, pa_eng state: {}, internal job state: {}".format( job.name, job.pa_job_state, job.state) )
try:
if job.name =="scannow":
JobScanNow(job)