@@ -65,6 +65,9 @@ cmdsrv_no_workers = 5
65
65
cmdsrv_job_poll_sleep_interval = 1
66
66
cmdsrv_max_concurrent_jobs = 7
67
67
68
+ cmdsrv_lower_job_priority_flag = None
69
+ cmdsrv_lower_job_priority_str = None
70
+
68
71
# Derived Variables
69
72
cmdsrv_dbpath = None
70
73
@@ -498,10 +501,15 @@ def start_job(job_id, job_info, status='STARTED'):
498
501
global running_job_count
499
502
global ansible_running_flag
500
503
global prereq_jobs
504
+ global cmdsrv_lower_job_priority_flag
505
+ global cmdsrv_lower_job_priority_str
501
506
502
507
job_info ['output_file' ] = '/tmp/job-' + str (job_id )
503
508
job_info ['file' ] = open (job_info ['output_file' ], 'w' )
504
- args = shlex .split (job_info ['job_command' ])
509
+ if cmdsrv_lower_job_priority_flag :
510
+ args = shlex .split (cmdsrv_lower_job_priority_str + job_info ['job_command' ])
511
+ else :
512
+ args = shlex .split (job_info ['job_command' ])
505
513
job_info ['subproc' ] = subprocess .Popen (args , stdout = job_info ['file' ], stderr = subprocess .STDOUT )
506
514
job_info ['job_pid' ] = job_info ['subproc' ].pid
507
515
job_info ['status' ] = status
@@ -2425,6 +2433,8 @@ def app_config():
2425
2433
global cmdsrv_no_workers
2426
2434
global cmdsrv_job_poll_sleep_interval
2427
2435
global cmdsrv_max_concurrent_jobs
2436
+ global cmdsrv_lower_job_priority_flag
2437
+ global cmdsrv_lower_job_priority_str
2428
2438
global cmdsrv_pid_file
2429
2439
global cmdsrv_ready_file
2430
2440
global kiwix_catalog_file
@@ -2467,6 +2477,8 @@ def app_config():
2467
2477
cmdsrv_no_workers = conf ['cmdsrv_no_workers' ]
2468
2478
cmdsrv_job_poll_sleep_interval = conf ['cmdsrv_job_poll_sleep_interval' ]
2469
2479
cmdsrv_max_concurrent_jobs = conf ['cmdsrv_max_concurrent_jobs' ]
2480
+ cmdsrv_lower_job_priority_flag = conf ['cmdsrv_lower_job_priority_flag' ]
2481
+ cmdsrv_lower_job_priority_str = conf ['cmdsrv_lower_job_priority_str' ]
2470
2482
cmdsrv_pid_file = conf ['cmdsrv_pid_file' ]
2471
2483
cmdsrv_ready_file = conf ['cmdsrv_ready_file' ]
2472
2484
kiwix_catalog_file = conf ['kiwix_catalog_file' ]
0 commit comments