Added logic to stop running multiple scan jobs.

100's of file changes at the same time caused FileMonitor to run many dozens of scan jobs.
Added logic to have FileMonitor delay new scan jobs while last scan job is still running.
This commit is contained in:
David Maisonave
2024-08-22 02:38:14 -04:00
parent bec3e33950
commit 16f9b6e6aa
4 changed files with 203 additions and 48 deletions

View File

@@ -46,6 +46,11 @@ config = {
# Timeout in seconds. This is how often FileMonitor will check the scheduler and (in-plugin mode) check if another job (Task) is in the queue.
"timeOut": 60,
# Timeout in seconds for delay processing of path scan jobs. This value should always be smaller than timeOut
"timeOutDelayProcess": 3,
# Maximum time to wait for a scan job to complete. Need this incase Stash gets restarted in the middle of a scan job.
"maxWaitTimeJobFinish": 30 * 60, # Wait 30 minutes max
# ApiKey only needed when Stash credentials are set and while calling FileMonitor via command line.
"apiKey" : "", # Example: "eyJabccideJIUfg1NigRInD345I6dfpXVCfd.eyJ1abcDEfGheHRlHJiJklMonPQ32FsVewtsfSIsImlhdCI6MTcyMzg2NzkwOH0.5bkHU6sfs3532dsryu1ki3iFBwnd_4AHs325yHljsPw"
# Enable to run metadata clean task after file deletion.