Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2f160bf

Browse files
author
Vladimir Ershov
committed
vanish at works
1 parentc795670 commit2f160bf

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

‎pgpro_scheduler--2.0.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ BEGIN
192192
USING HINT='you cannot use''run_after'' and''depends_on'' parameters at the same time';
193193
END IF;
194194

195-
IF max_wait_intervalIS NOT NULLAND run_after ISNULL THEN
195+
IF max_wait_intervalIS NOT NULLAND run_afterISNOTNULL THEN
196196
last_avail := run_after+ max_wait_interval;
197197
ELSE
198198
last_avail :=NULL;

‎src/scheduler_manager.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,8 +1177,13 @@ int scheduler_vanish_expired_jobs(scheduler_manager_ctx_t *ctx, task_type_t type
11771177
intmove_ret;
11781178
char*ts;
11791179
boolts_hires= false;
1180+
TimestampTz*check_time;
1181+
intinterval;
1182+
1183+
check_time=type==CronJob ?&(ctx->next_expire_time):&(ctx->next_at_expire_time);
1184+
interval=type==CronJob ?30:25;
11801185

1181-
if(ctx->next_expire_time>GetCurrentTimestamp())return-1;
1186+
if(*check_time>GetCurrentTimestamp())return-1;
11821187
pgstat_report_activity(STATE_RUNNING,"vanish expired tasks");
11831188
START_SPI_SNAP();
11841189
expired=type==CronJob ?
@@ -1227,7 +1232,7 @@ int scheduler_vanish_expired_jobs(scheduler_manager_ctx_t *ctx, task_type_t type
12271232
ret=0;
12281233
}
12291234
STOP_SPI_SNAP();
1230-
ctx->next_expire_time=timestamp_add_seconds(0,30);
1235+
*check_time=timestamp_add_seconds(0,interval);
12311236
pgstat_report_activity(STATE_IDLE,"vanish expired tasks done");
12321237

12331238
returnret;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp