Rthur2003 commited on
Commit
d5b9f5c
·
1 Parent(s): fa71257

feat: background analysis jobs servisi ile queueing ve progress tracking eklendi

Browse files
Files changed (1) hide show
  1. app/services/analysis_jobs.py +6 -1
app/services/analysis_jobs.py CHANGED
@@ -241,7 +241,12 @@ class Job:
241
  }
242
  position = cpu_gate.position(self.id)
243
  if not self.finished and position is not None:
244
- data["queue"] = {"position": position, "estimatedWaitSec": cpu_gate.estimated_wait(position)}
 
 
 
 
 
245
  if self.cached:
246
  data["cached"] = True
247
  return data
 
241
  }
242
  position = cpu_gate.position(self.id)
243
  if not self.finished and position is not None:
244
+ data["queue"] = {
245
+ "position": position,
246
+ # Everyone in line before you, plus whoever is on the CPU now.
247
+ "ahead": position - 1 + cpu_gate.busy,
248
+ "estimatedWaitSec": cpu_gate.estimated_wait(position),
249
+ }
250
  if self.cached:
251
  data["cached"] = True
252
  return data