aboutsummaryrefslogtreecommitdiff
path: root/src/solver_sjf.c
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-08-25 07:41:30 +0530
committersinanmohd <sinan@sinanmohd.com>2024-08-25 07:44:00 +0530
commit0619958e246182c02d300fe82e49f8c9d2b3a162 (patch)
tree2a12a67f520d43642708dcc989c4fa2c121bf02c /src/solver_sjf.c
parentee76b7aaf3e39fac459ac819d25b2c64c848bb3e (diff)
evanix: implement --max-time flag
Diffstat (limited to 'src/solver_sjf.c')
-rw-r--r--src/solver_sjf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/solver_sjf.c b/src/solver_sjf.c
index c81f718..4cbdbc1 100644
--- a/src/solver_sjf.c
+++ b/src/solver_sjf.c
@@ -18,11 +18,14 @@ int solver_sjf(struct job **job, struct job_clist *q, int32_t resources)
continue;
cost_cur = job_cost_recursive(j);
+ if (cost_cur < 0)
+ return cost_cur;
+
if (cost_cur > resources) {
job_stale_set(j);
if (evanix_opts.solver_report) {
printf("❌ refusing to build %s, cost: %d\n",
- j->drv_path, job_cost_recursive(j));
+ j->drv_path, cost_cur);
}
}