mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-07 10:31:46 +00:00
debugging for inference-job loop
This commit is contained in:
1 parent
95173e032f
commit
8313558795
1 file changed
+8
@@ -35,6 +35,8 @@ pub async fn main_loop(job_dependencies: JobDependencies) {
|
||||
let mut sort_by_priority_count = 0;
|
||||
|
||||
while !job_dependencies.job.system.application_shutdown.get() {
|
||||
info!("Job loop iteration starting...");
|
||||
|
||||
if let Some(pause_file) = job_dependencies.fs.maybe_pause_file.as_deref() {
|
||||
while file_exists(pause_file) {
|
||||
warn!("Pause file exists. Pausing until deleted: {:?}", pause_file);
|
||||
@@ -53,6 +55,8 @@ pub async fn main_loop(job_dependencies: JobDependencies) {
|
||||
|
||||
let batch_query_start_time = Instant::now();
|
||||
|
||||
info!("Querying jobs...");
|
||||
|
||||
let maybe_available_jobs = list_available_generic_inference_jobs(ListAvailableGenericInferenceJobArgs {
|
||||
num_records: job_dependencies.job.system.job_batch_size,
|
||||
is_debug_worker: false, // TODO
|
||||
@@ -117,6 +121,8 @@ pub async fn main_loop(job_dependencies: JobDependencies) {
|
||||
|
||||
error_timeout_millis = START_TIMEOUT_MILLIS; // reset
|
||||
|
||||
info!("Job loop batch processing complete. Sleeping {} ms", job_dependencies.job.system.job_batch_wait_millis);
|
||||
|
||||
std::thread::sleep(Duration::from_millis(job_dependencies.job.system.job_batch_wait_millis));
|
||||
}
|
||||
|
||||
@@ -192,6 +198,8 @@ async fn process_job_batch(job_dependencies: &JobDependencies, jobs: Vec<Availab
|
||||
job_duration.as_millis() as u64,
|
||||
&job_duration_instrumentation_attributes);
|
||||
}
|
||||
|
||||
info!("Process job batch loop ended.");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user