From a76c25b19fde79ebc8a805307f274c77a93aec99 Mon Sep 17 00:00:00 2001 From: xbgmsharp Date: Sun, 25 May 2025 15:47:37 +0200 Subject: [PATCH] Update cron process output, add autodiscovery --- tests/sql/cron_run_jobs.sql | 7 ++++++- tests/sql/cron_run_jobs.sql.output | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/sql/cron_run_jobs.sql b/tests/sql/cron_run_jobs.sql index 8b733d9..f644899 100644 --- a/tests/sql/cron_run_jobs.sql +++ b/tests/sql/cron_run_jobs.sql @@ -15,7 +15,12 @@ select current_database(); \echo 'Check the number of process pending' -- Should be 24 SELECT count(*) as jobs from public.process_queue pq where pq.processed is null; ---set role scheduler +-- Switch to the scheduler role +--\echo 'Switch to the scheduler role' +--SET ROLE scheduler; +-- Should be 24 +SELECT count(*) as jobs from public.process_queue pq where pq.processed is null; +-- Run the cron jobs SELECT public.run_cron_jobs(); -- Check any pending job SELECT count(*) as any_pending_jobs from public.process_queue pq where pq.processed is null; diff --git a/tests/sql/cron_run_jobs.sql.output b/tests/sql/cron_run_jobs.sql.output index 3facc67..ebc42d8 100644 --- a/tests/sql/cron_run_jobs.sql.output +++ b/tests/sql/cron_run_jobs.sql.output @@ -9,6 +9,9 @@ Check the number of process pending -[ RECORD 1 ] jobs | 26 +-[ RECORD 1 ] +jobs | 26 + -[ RECORD 1 ]-+- run_cron_jobs |