Skip to content

Commit

Permalink
added 30 sec graceperiod (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
acn-sbuad authored Oct 16, 2023
1 parent 78eaad9 commit 19af611
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE OR REPLACE FUNCTION notifications.getorders_pastsendtime_updatestatus()
RETURNS TABLE(notificationorders jsonb)
LANGUAGE 'plpgsql'
AS $BODY$
BEGIN
RETURN QUERY
UPDATE notifications.orders
SET processedstatus = 'Processing'
WHERE _id IN (select _id
from notifications.orders
where processedstatus = 'Registered'
and requestedsendtime <= now() + INTERVAL '30 seconds'
limit 50)
RETURNING notificationorder AS notificationorders;
END;
$BODY$;

0 comments on commit 19af611

Please sign in to comment.