diff options
author | sinanmohd <sinan@sinanmohd.com> | 2024-08-25 07:41:30 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2024-08-25 07:44:00 +0530 |
commit | 0619958e246182c02d300fe82e49f8c9d2b3a162 (patch) | |
tree | 2a12a67f520d43642708dcc989c4fa2c121bf02c /src/solver_sjf.c | |
parent | ee76b7aaf3e39fac459ac819d25b2c64c848bb3e (diff) |
evanix: implement --max-time flag
Diffstat (limited to 'src/solver_sjf.c')
-rw-r--r-- | src/solver_sjf.c | 5 |
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); } } |