Skip to content

Commit a19700d

Browse files
committed
fix: lint sql
1 parent b03abb0 commit a19700d

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

supabase/migrations/20251014160000_secure_process_function_queue.sql

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ SECURITY DEFINER
77
SET
88
search_path = '' AS $$
99
DECLARE
10-
request_id text;
1110
headers jsonb;
1211
url text;
1312
queue_size bigint;
1413
calls_needed int;
15-
i int;
1614
BEGIN
1715
-- Check if the queue has elements
1816
EXECUTE format('SELECT count(*) FROM pgmq.q_%I', queue_name) INTO queue_size;
@@ -30,18 +28,19 @@ BEGIN
3028

3129
-- Call the endpoint multiple times if needed
3230
FOR i IN 1..calls_needed LOOP
33-
SELECT INTO request_id net.http_post(
31+
PERFORM net.http_post(
3432
url := url,
3533
headers := headers,
3634
body := jsonb_build_object('queue_name', queue_name, 'batch_size', batch_size),
3735
timeout_milliseconds := 15000
3836
);
3937
END LOOP;
4038

41-
RETURN request_id;
39+
-- Return the number of calls made
40+
RETURN calls_needed::bigint;
4241
END IF;
4342

44-
RETURN NULL;
43+
RETURN 0::bigint;
4544
END;
4645
$$;
4746

0 commit comments

Comments
 (0)