### DB ### BACKEND *** Need to use thread-safe sessions per Thread, half-assed version did not work * create A WalkTree( dir, func ) that calls func(file) per file ... for use * in AI, but also maybe gen hash, etc. * 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 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