DDP: Need to use thread-safe sessions per Thread, half-assed version did not work ### DB ### BACKEND * need a "batch" processing system that uses ionice to minimise load on mara and is threaded and used DB to interact with gunicorn'd pa * pa_job_manager, needs ai code * needs broad jobs to: DONE: find files in {import_dir & storage_dir} DONE: calc thumbs/hashes { " } run AI against { " } move files from import_dir to appropriate sub_dir in storage_dir (list will come from pa web) NEW_FILE -> add, has_unidentified_face ?has_face?, AI_SCAN: id date of scan version of code? settings used AI_SCAN_FILE_LINK id to link to AI_scan refimg used/found num jobs active, num jobs completed, lets bin them from the pa_job_manager table -> calculate them everytime (simple select count(1) from job where pa_job_state == "Completed") FE does not really care what 'state' the job engine is in anyway, so maybe we bin that table, make it a local class to pa_job_manager? When AI kicks in, it processes per person per DIR, only compares to an image if it has_unidentified_face Admin -> reset face_flag AI -> rescan