MED-103: create job
This commit is contained in:
@@ -38,7 +38,9 @@ function getSpokenLanguages(spokenLanguages?: string) {
|
||||
}
|
||||
|
||||
export default async function syncConnectedOnline() {
|
||||
const isProd = process.env.NODE_ENV === 'production';
|
||||
const isProd = !['test', 'localhost'].some((pathString) =>
|
||||
process.env.NEXT_PUBLIC_SITE_URL?.includes(pathString),
|
||||
);
|
||||
|
||||
const baseUrl = process.env.CONNECTED_ONLINE_URL;
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
select
|
||||
cron.schedule(
|
||||
'sync-connected-online-every-night', -- Unique job name
|
||||
'0 1 * * *', -- Cron schedule: every night at 04:00 (GMT +3)
|
||||
$$
|
||||
select
|
||||
net.http_post(
|
||||
url := 'https://test.medreport.ee/api/job/sync-connected-online',
|
||||
headers := jsonb_build_object(
|
||||
'x-jobs-api-key', 'fd26ec26-70ed-11f0-9e95-431ac3b15a84'
|
||||
)
|
||||
) as request_id;
|
||||
$$
|
||||
);
|
||||
Reference in New Issue
Block a user