Skip to content

Commit 31fe586

Browse files
committed
fix: remove timeout_milliseconds option
It's ignored for now
1 parent 3d52e77 commit 31fe586

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

docs/api.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ net.http_get(
1717
-- key/value pairs to be url encoded and appended to the `url`
1818
params jsonb default '{}'::jsonb,
1919
-- key/values to be included in request headers
20-
headers jsonb default '{}'::jsonb,
21-
-- the maximum number of milliseconds the request may take before being cancelled
22-
timeout_milliseconds int default 1000
20+
headers jsonb default '{}'::jsonb
2321
)
2422
-- request_id reference
2523
returns bigint
@@ -61,9 +59,7 @@ net.http_post(
6159
-- key/value pairs to be url encoded and appended to the `url`
6260
params jsonb default '{}'::jsonb,
6361
-- key/values to be included in request headers
64-
headers jsonb default '{"Content-Type": "application/json"}'::jsonb,
65-
-- the maximum number of milliseconds the request may take before being cancelled
66-
timeout_milliseconds int default 1000
62+
headers jsonb default '{"Content-Type": "application/json"}'::jsonb
6763
)
6864
-- request_id reference
6965
returns bigint

sql/pg_net--0.1.sql

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ create table net.http_request_queue(
1414
url text not null,
1515
headers jsonb not null,
1616
body bytea,
17-
timeout_milliseconds int not null,
1817
created timestamptz not null default now()
1918
);
2019

@@ -92,9 +91,7 @@ create or replace function net.http_get(
9291
-- key/value pairs to be url encoded and appended to the `url`
9392
params jsonb default '{}'::jsonb,
9493
-- key/values to be included in request headers
95-
headers jsonb default '{}'::jsonb,
96-
-- the maximum number of milliseconds the request may take before being cancelled
97-
timeout_milliseconds int default 1000
94+
headers jsonb default '{}'::jsonb
9895
)
9996
-- request_id reference
10097
returns bigint
@@ -112,12 +109,11 @@ begin
112109
from jsonb_each_text(params);
113110

114111
-- Add to the request queue
115-
insert into net.http_request_queue(method, url, headers, timeout_milliseconds)
112+
insert into net.http_request_queue(method, url, headers)
116113
values (
117114
'GET',
118115
net._encode_url_with_params_array(url, params_array),
119-
headers,
120-
timeout_milliseconds
116+
headers
121117
)
122118
returning id
123119
into request_id;
@@ -136,9 +132,7 @@ create or replace function net.http_post(
136132
-- key/value pairs to be url encoded and appended to the `url`
137133
params jsonb default '{}'::jsonb,
138134
-- key/values to be included in request headers
139-
headers jsonb default '{"Content-Type": "application/json"}'::jsonb,
140-
-- the maximum number of milliseconds the request may take before being cancelled
141-
timeout_milliseconds int DEFAULT 1000
135+
headers jsonb default '{"Content-Type": "application/json"}'::jsonb
142136
)
143137
-- request_id reference
144138
returns bigint
@@ -186,13 +180,12 @@ begin
186180
jsonb_each_text(params);
187181

188182
-- Add to the request queue
189-
insert into net.http_request_queue(method, url, headers, body, timeout_milliseconds)
183+
insert into net.http_request_queue(method, url, headers, body)
190184
values (
191185
'POST',
192186
net._encode_url_with_params_array(url, params_array),
193187
headers,
194-
body::text::bytea,
195-
timeout_milliseconds
188+
body::text::bytea
196189
)
197190
returning id
198191
into request_id;

0 commit comments

Comments
 (0)