supabase / pg_net

A PostgreSQL extension that enables asynchronous (non-blocking) HTTP/HTTPS requests with SQL
https://supabase.github.io/pg_net
Apache License 2.0
215 stars 16 forks source link

Reject requests when worker is down #47

Closed steve-chavez closed 2 years ago

steve-chavez commented 2 years ago

Helps with https://github.com/supabase/pg_net/issues/45.

When the worker is down for any reason the request queue will now reject insertions.

-- kill the worker 
-- select pg_terminate_backend((select pid from pg_stat_activity where backend_type = 'pg_net worker'));

select net.http_get('https://github.com');

ERROR:  the pg_net background worker must be up when doing requests
DETAIL:  the pg_net background worker is down due to an internal error and cannot process requests
HINT:  make sure that you didn't modify any of pg_net internal tables or used them for foreign key references