From e526d99389897ba340ce58ed342b183011568b2e Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Thu, 2 Oct 2025 17:54:51 +1000 Subject: [PATCH] no longer maintain too much state per user, remove all need to update it --- pa_job_manager.py | 51 ----------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/pa_job_manager.py b/pa_job_manager.py index 658df9e..8be04d0 100644 --- a/pa_job_manager.py +++ b/pa_job_manager.py @@ -513,42 +513,6 @@ class PA_JobManager_FE_Message(Base): return "" - - ############################################################################## # PAprint(): convenience function to prepend a timestamp to a printed string ############################################################################## @@ -1131,7 +1095,6 @@ def DisconnectAllOverrides(job): def JobForceScan(job): JobProgressState( job, "In Progress" ) DisconnectAllOverrides(job) - session.query(PA_UserState).delete() session.query(FaceFileLink).delete() session.query(FaceRefimgLink).delete() session.query(Face).delete() @@ -1668,18 +1631,6 @@ def find_last_successful_ai_scan(job): return ai_job.last_update.timestamp() return 0 -#################################################################################################################################### -# when an import job actually finds new files, then the pa_user_state caches will become invalid (offsets are now wrong) -#################################################################################################################################### -def DeleteOldPA_UserState(job): -# clear them out for now - this is 'dumb', just delete ALL. Eventually, can do this based on just the path &/or whether the last_used is -# newer than this delete moment (only would be a race condition between an import changing things and someone simultaneously viewing) -# path=[jex.value for jex in job.extra if jex.name == "path"][0] - session.query(PA_UserState).delete() - return - - - #################################################################################################################################### # JobImportDir(): job that scan import dir and processes entries in there - key function that uses os.walk() to traverse the # file system and calls AddFile()/AddDir() as necessary @@ -1788,8 +1739,6 @@ def JobImportDir(job): if found_new_files: job.extra.append( JobExtra( name="new_files", value=str(found_new_files) ) ) session.add(job) - # this will invalidate pa_user_state for this path's contents (offsets are now wrong), clear them out - DeleteOldPA_UserState(job) rm_cnt=HandleAnyFSDeletions(job)