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
Copy file name to clipboardExpand all lines: src/scheduler_job.c
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ job_t *get_jobs_to_do(char *nodename, int *n, int *is_error)
25
25
intret, got, i;
26
26
Oidargtypes[1] = { TEXTOID };
27
27
Datumvalues[1];
28
-
constchar*get_job_sql="select at.start_at, at.last_start_available, at.cron, max_run_time, cron.max_instances, cron.executor, cron.next_time_statement from schedule.at at, schedule.cron cron where start_at <= 'now' and not at.active and (last_start_available is NULL OR last_start_available > 'now') and at.cron = cron.id AND cron.node = $1 order by at.start_at";
28
+
constchar*get_job_sql="select at.start_at, at.last_start_available, at.cron, max_run_time, cron.max_instances, cron.executor, cron.next_time_statement from at at, cron cron where start_at <= 'now' and not at.active and (last_start_available is NULL OR last_start_available > 'now') and at.cron = cron.id AND cron.node = $1 order by at.start_at";
29
29
30
30
*is_error=*n=0;
31
31
START_SPI_SNAP();
@@ -68,7 +68,7 @@ job_t *get_expired_jobs(char *nodename, int *n, int *is_error)
68
68
69
69
*n=*is_error=0;
70
70
initStringInfo(&sql);
71
-
appendStringInfo(&sql, "select start_at, last_start_available, cron, started, active from schedule.at where last_start_available < 'now' and not active and node = '%s'", nodename);
71
+
appendStringInfo(&sql, "select start_at, last_start_available, cron, started, active from at where last_start_available < 'now' and not active and node = '%s'", nodename);
72
72
ret=SPI_execute(sql.data, true, 0);
73
73
if(ret==SPI_OK_SELECT)
74
74
{
@@ -115,8 +115,8 @@ int move_job_to_log(job_t *j, bool status)
constchar*del_sql="delete from schedule.at where start_at = $1 and cron = $2";
119
-
constchar*sql="insert into schedule.log (start_at, last_start_available, retry, cron, node, started, status, finished, message) SELECT start_at, last_start_available, retry, cron, node, started, $1 as status, 'now'::timestamp as finished, $2 as message from schedule.at where cron = $3 and start_at = $4";
118
+
constchar*del_sql="delete from at where start_at = $1 and cron = $2";
119
+
constchar*sql="insert into log (start_at, last_start_available, retry, cron, node, started, status, finished, message) SELECT start_at, last_start_available, retry, cron, node, started, $1 as status, 'now'::timestamp as finished, $2 as message from at where cron = $3 and start_at = $4";
120
120
121
121
/* in perl was this at first $status = 0 if $job->{spoiled}; skip so far */
@@ -269,7 +265,7 @@ scheduler_task_t *scheduler_get_active_tasks(scheduler_manager_ctx_t *ctx, int *
269
265
270
266
*nt=0;
271
267
initStringInfo(&sql);
272
-
appendStringInfo(&sql, "select id, rule, postpone, _next_exec_time, next_time_statement from schedule.cron where active and not broken and (start_date <= 'now' or start_date is null) and (end_date <= 'now' or end_date is null) and node = '%s'", ctx->nodename);
268
+
appendStringInfo(&sql, "select id, rule, postpone, _next_exec_time, next_time_statement from cron where active and not broken and (start_date <= 'now' or start_date is null) and (end_date <= 'now' or end_date is null) and node = '%s'", ctx->nodename);
0 commit comments