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

Commit1792a38

Browse files
author
Vladimir Ershov
committed
fix for date
1 parentc0f74cd commit1792a38

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎pgpro_scheduler--2.0.sql

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,11 @@ DECLARE
405405
clean_cron jsonb;
406406
Ninteger;
407407
nametext;
408+
updatePrevboolean;
408409
BEGIN
409410

411+
updatePrev := true;
412+
410413
IF NOT params?'cron'AND NOT params?'rule'AND NOT params?'date'AND NOT params?'dates' THEN
411414
RAISE EXCEPTION'There is no information about job''s schedule'
412415
USING HINT='Use''cron'' - cron string,''rule'' - json to set schedule rules or''date'' and''dates'' to set exact date(s)';
@@ -416,13 +419,11 @@ BEGIN
416419
EXECUTE'SELECT cron2jsontext($1::cstring)::jsonb'
417420
INTO cron
418421
USING params->>'cron';
419-
IF prevIS NOT NULL THEN
420-
cron := prev|| cron;
421-
END IF;
422422
END IF;
423423

424424
IF params?'rule' THEN
425425
rule := params->'rule';
426+
updatePrev := false;
426427
END IF;
427428

428429
cron := coalesce(cron,'{}'::jsonb)|| coalesce(rule,'{}'::jsonb);
@@ -448,6 +449,10 @@ BEGIN
448449
cron := cron|| jsonb_build_object('dates', array_to_json(dates));
449450
END IF;
450451

452+
IF updatePrevAND prevIS NOT NULL THEN
453+
cron := prev|| cron;
454+
END IF;
455+
451456
clean_cron :='{}'::jsonb;
452457
FOR nameINSELECT*FROM unnest('{dates, crontab, onstart, days, hours, wdays, months, minutes}'::text[])
453458
LOOP

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp