laznic
08/11/2021, 9:03 AMnet.http_post
?Steve
08/11/2021, 3:58 PMSteve
08/11/2021, 4:00 PMlaznic
08/11/2021, 5:27 PMSteve
08/11/2021, 5:29 PMlaznic
08/11/2021, 5:32 PMlaznic
08/11/2021, 5:32 PMCREATE OR REPLACE FUNCTION start_tournaments()
RETURNS void
AS $$
declare
tournament_ids bigint[];
BEGIN
select array_agg(id) from public.tournaments
into tournament_ids;
select
net.http_post(
url := 'https://webhook.site/0218ca20-e51e-4780-9147-ead73038749b',
body := jsonb_build_object('tournament_ids', tournament_ids)
);
END;
$$ LANGUAGE plpgsql;
select
cron.schedule(
'webhook-every-minute', -- name of the cron job
'* * * * *', -- every minute
$$
select start_tournaments();
$$
);
laznic
08/11/2021, 5:33 PMlaznic
08/11/2021, 5:34 PMERROR: query has no destination for result data HINT: if you want to discard the results of a SELECT, use PERFORM instead.
Steve
08/11/2021, 5:35 PMperform net.http_post
instead of select net.http_post
laznic
08/11/2021, 5:36 PMlaznic
08/11/2021, 5:37 PMselect
to perform
in that part of the function 😄Steve
08/11/2021, 5:39 PM