20 lines
627 B
SQL
20 lines
627 B
SQL
-- Enable required extensions for cron jobs and HTTP requests
|
|
create extension if not exists pg_cron;
|
|
create extension if not exists pg_net;
|
|
|
|
-- Schedule the test-medipost-responses job to run every 15 minutes
|
|
select
|
|
cron.schedule(
|
|
'send-test-medipost-responses-every-15-minutes', -- Unique job name
|
|
'*/15 * * * *', -- Cron schedule: every 15 minutes
|
|
$$
|
|
select
|
|
net.http_post(
|
|
url := 'https://test.medreport.ee/api/job/test-medipost-responses',
|
|
headers := jsonb_build_object(
|
|
'x-jobs-api-key', 'fd26ec26-70ed-11f0-9e95-431ac3b15a84'
|
|
)
|
|
) as request_id;
|
|
$$
|
|
);
|