You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
WITH moved_rowsAS (DELETEfrom ONLY at_jobs_submitted aWHEREa.id= job_id RETURNING a.*)INSERT INTO at_jobs_doneSELECT*,NULLas start_time, falseas status,'job was canceled'as reasonFROM moved_rows;
174
+
RETURN true;
175
+
ELSE
176
+
EXECUTE'SELECT count(*) FROM at_jobs_process WHERE owner = session_user AND id = $1' INTO s_count USING job_id;
Copy file name to clipboardExpand all lines: src/scheduler_job.c
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -167,7 +167,7 @@ job_t *_at_get_jobs_to_do(char *nodename, int *n, int *is_error, int limit)
167
167
Oidargtypes[2]= {TEXTOID,INT4OID };
168
168
Datumvalues[2];
169
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
-
constchar*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";
170
+
constchar*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 = $1and not canceledorder by at, submit_time limit $2";
171
171
172
172
*is_error=*n=0;
173
173
START_SPI_SNAP();
@@ -366,9 +366,17 @@ int resubmit_at_job(job_t *j, TimestampTz next)
366
366
intret;
367
367
constchar*sql="WITH moved_rows AS (DELETE from ONLY at_jobs_process a WHERE a.id = $1 RETURNING a.*) INSERT INTO at_jobs_submitted SELECT id, node, name, comments, $2, do_sql, params, depends_on, executor, owner, last_start_available, attempt +1 , resubmit_limit, postpone, max_run_time, submit_time FROM moved_rows";