From 4df3274624b1c1d84334304bc7c1f72661d00537 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Thu, 14 Jan 2021 21:46:32 +1100 Subject: [PATCH] added basics of job idea to TODO --- TODO | 54 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/TODO b/TODO index 9710e80..fa47a9c 100644 --- a/TODO +++ b/TODO @@ -2,29 +2,45 @@ * create tables ### BACKEND - * probably need a "batch" processing system that uses ionice to minimise load on mara + * 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 + + DB tables to share between pa and pa_jobs: + create table pa_job_state ( state string, num_jobs_active integer, num_jobs_complete ) + create table pa_jobs ( job_id, <...> ) + + pa_jobs (threaded python add separate from photoassistant) + takes over files.py + has ai.py + needs broad jobs to: + find files in {import_dir & storage_dir} + calc thumbs/hashes { " } + run AI against { " } + move files from import_dir to appropriate sub_dir in storage_dir (list will come from pa web) + + to keep html easy, can keep routes: + /jobs/import/ -> importlog.html + /jobs/ai/ -> importlog.html??? + + but not sure if any job won't have passes, num files, etc. BUT if it ever does this is how we deal with it + + on start-up: + set state: initialising + get settings, if no import_dir -> set state: Configuration Needed + check DB for any files + -> if some, set state: awaiting jobs + -> if none, set state: Find Files (run that code) + -> when job finished, then Import Files (import_dir only) + -> when job finished, the set state: awating jobs + + + implications, pa_job needs to know if it depends on another, e.g. do find before import (in example above) + pa web needs to show status for the job engine IN YOUR FACE when not at awaiting jobs yet, afterwards, maybe a simple jobs() that is clickable on the gui? + ### UI - * use native file dialog box to set import_path in a "settings page" - * basic browse the import path - * some sort of log of import like: - -State: finding files / found X files / AI for -Progress: overall # of passes -Progress: X of Y files -History: -