Skip to content

Commit 76a2ee6

Browse files
author
Vladimir Ershov
committed
depends_on feature
1 parent 2f160bf commit 76a2ee6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/scheduler_job.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ job_t *_at_get_jobs_to_do(char *nodename, int *n, int *is_error, int limit)
166166
int ret, got, i;
167167
Oid argtypes[2] = { TEXTOID, INT4OID };
168168
Datum values[2];
169-
const char *get_job_sql = "select id, at, last_start_available, max_run_time, executor from ONLY at_jobs_submitted where at <= 'now' and (last_start_available is NULL OR last_start_available > 'now') AND node = $1 order by at, submit_time limit $2";
169+
/* const char *get_job_sql = "select id, at, last_start_available, max_run_time, executor from ONLY at_jobs_submitted where at <= 'now' and (last_start_available is NULL OR last_start_available > 'now') AND node = $1 order by at, submit_time limit $2"; */
170+
const char *get_job_sql = "select id, at, last_start_available, max_run_time, executor from ONLY at_jobs_submitted s where ((not exists ( select * from ONLY at_jobs_submitted s2 where s2.id = any(s.depends_on)) AND not exists ( select * from ONLY at_jobs_process p where p.id = any(s.depends_on)) AND s.depends_on is NOT NULL and s.at IS NULL) OR ( s.at IS NOT NULL AND at <= 'now' and (last_start_available is NULL OR last_start_available > 'now'))) and node = $1 order by at, submit_time limit $2";
170171

171172
*is_error = *n = 0;
172173
START_SPI_SNAP();

src/scheduler_manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ int scheduler_vanish_expired_jobs(scheduler_manager_ctx_t *ctx, task_type_t type
12101210
}
12111211
else
12121212
{
1213-
set_job_error(&expired[i], "job start time %s expired", ts);
1213+
set_job_error(&expired[i], "job expired");
12141214
}
12151215

12161216
move_ret = move_job_to_log(&expired[i], 0, false);

0 commit comments

Comments
 (0)