aboutsummaryrefslogtreecommitdiff
path: root/src/jobs.c
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-07-19 08:29:26 +0530
committersinanmohd <sinan@sinanmohd.com>2024-07-19 08:29:33 +0530
commitcf02c0ac1b7d8ed930a03339f639f819b3ad127b (patch)
tree34c4dbc359b469ca002f60ca9d3b0f0528d0944a /src/jobs.c
parent7d2e561246ed29eca19fe2a666ec2ae6e94964ad (diff)
evanix: add --cache-status flag
Diffstat (limited to 'src/jobs.c')
-rw-r--r--src/jobs.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/jobs.c b/src/jobs.c
index fc35f83..9d50950 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -388,9 +388,11 @@ int job_read(FILE *stream, struct job **job)
if (ret < 0)
goto out_free;
- ret = job_read_cache(j);
- if (ret < 0)
- goto out_free;
+ if (evanix_opts.cache_status) {
+ ret = job_read_cache(j);
+ if (ret < 0)
+ goto out_free;
+ }
out_free:
cJSON_Delete(root);
@@ -441,8 +443,6 @@ static int job_new(struct job **j, char *name, char *drv_path, char *attr,
return -errno;
}
job->scheduled = false;
- /* unset by job_read_cache() */
- job->stale = true;
job->reported = false;
job->id = -1;
@@ -458,6 +458,13 @@ static int job_new(struct job **j, char *name, char *drv_path, char *attr,
job->parents_filled = 0;
job->parents = NULL;
+ if (evanix_opts.cache_status) {
+ job->stale = true;
+ } else {
+ job->insubstituters = false;
+ job->stale = false;
+ }
+
if (attr != NULL) {
job->nix_attr_name = strdup(attr);
if (job->nix_attr_name == NULL) {