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
For a separate project, using a similar query, it appeared that a second process trying to pull tasks off would sometimes get none back, instead of the next unlocked one. The following query, similar to queue's query, did not work well (the returning
WITH u AS (
SELECT
repository_id AS target_repository_id,
format(full_path, path) AS final_path
FROMsite.repositoryJOINsite.provider p ONp.provider_id= provider_id_provider
WHERE last_checked IS NULLor last_checked < Now() - INTERVAL '1 hour'ORDER BY last_checked asc
FOR UPDATE SKIP LOCKED
LIMIT1
)
UPDATEsite.repositorySET last_checked = Now()
FROM u
WHERE repository_id = target_repository_id
RETURNING repository_id, final_path
Whereas this one worked as expected:
with selected AS (
UPDATEsite.repositorySET last_checked = Now()
WHERE repository_id = (
SELECT
repository_id
FROMsite.repositoryWHERE last_checked IS NULLor last_checked < Now() - INTERVAL '1 hour'ORDER BY last_checked, repository_id asc
FOR UPDATE SKIP LOCKED
LIMIT1
)
RETURNING repository_id
)
SELECT
repository_id AS target_repository_id,
format(full_path, path) AS final_path
FROMsite.repositoryJOINsite.provider p ONp.provider_id= provider_id_provider
WHERE repository_id = (select repository_id from selected)
The text was updated successfully, but these errors were encountered:
For a separate project, using a similar query, it appeared that a second process trying to pull tasks off would sometimes get none back, instead of the next unlocked one. The following query, similar to queue's query, did not work well (the returning
Whereas this one worked as expected:
The text was updated successfully, but these errors were encountered: