@@ -171,7 +171,6 @@ worker_main(Datum main_arg)
171
171
CURL * eh = NULL ;
172
172
CURLMsg * msg = NULL ;
173
173
int still_running = 0 , msgs_left = 0 ;
174
- int http_status_code ;
175
174
int res ;
176
175
177
176
pqsignal (SIGTERM , handle_sigterm );
@@ -184,9 +183,6 @@ worker_main(Datum main_arg)
184
183
185
184
while (!got_sigterm )
186
185
{
187
- int queue_query_rc ;
188
- int ttl_query_rc ;
189
-
190
186
WaitLatch (& MyProc -> procLatch ,
191
187
WL_LATCH_SET | WL_TIMEOUT | WL_EXIT_ON_PM_DEATH ,
192
188
1000L ,
@@ -221,7 +217,7 @@ worker_main(Datum main_arg)
221
217
argTypes [1 ] = INT4OID ;
222
218
argValues [1 ] = Int32GetDatum (batch_size );
223
219
224
- ttl_query_rc = SPI_execute_with_args ("\
220
+ int ttl_query_rc = SPI_execute_with_args ("\
225
221
WITH\
226
222
rows AS (\
227
223
SELECT ctid\
@@ -248,7 +244,7 @@ worker_main(Datum main_arg)
248
244
argTypes [0 ] = INT4OID ;
249
245
argValues [0 ] = Int32GetDatum (batch_size );
250
246
251
- queue_query_rc = SPI_execute_with_args ("\
247
+ int queue_query_rc = SPI_execute_with_args ("\
252
248
WITH\
253
249
rows AS (\
254
250
SELECT id\
@@ -339,7 +335,6 @@ worker_main(Datum main_arg)
339
335
eh = msg -> easy_handle ;
340
336
341
337
if (return_code != CURLE_OK ) {
342
- int failed_query_rc ;
343
338
int argCount = 2 ;
344
339
Oid argTypes [2 ];
345
340
Datum argValues [2 ];
@@ -354,7 +349,7 @@ worker_main(Datum main_arg)
354
349
argTypes [1 ] = CSTRINGOID ;
355
350
argValues [1 ] = CStringGetDatum (error_msg );
356
351
357
- failed_query_rc = SPI_execute_with_args ("\
352
+ int failed_query_rc = SPI_execute_with_args ("\
358
353
insert into net._http_response(id, error_msg) values ($1, $2)" ,
359
354
argCount , argTypes , argValues , NULL , false, 1 );
360
355
@@ -363,14 +358,14 @@ worker_main(Datum main_arg)
363
358
ereport (ERROR , errmsg ("Error when inserting failed response: %s" , SPI_result_code_string (failed_query_rc )));
364
359
}
365
360
} else {
366
- int succ_query_rc ;
367
361
int argCount = 6 ;
368
362
Oid argTypes [6 ];
369
363
Datum argValues [6 ];
370
364
char nulls [6 ];
371
365
CurlData * cdata = NULL ;
372
366
char * contentType = NULL ;
373
367
bool timedOut = false;
368
+ int http_status_code ;
374
369
375
370
curl_easy_getinfo (eh , CURLINFO_RESPONSE_CODE , & http_status_code );
376
371
curl_easy_getinfo (eh , CURLINFO_CONTENT_TYPE , & contentType );
@@ -406,7 +401,7 @@ worker_main(Datum main_arg)
406
401
argValues [5 ] = BoolGetDatum (timedOut );
407
402
nulls [5 ] = ' ' ;
408
403
409
- succ_query_rc = SPI_execute_with_args ("\
404
+ int succ_query_rc = SPI_execute_with_args ("\
410
405
insert into net._http_response(id, status_code, content, headers, content_type, timed_out) values ($1, $2, $3, $4, $5, $6)" ,
411
406
argCount , argTypes , argValues , nulls , false, 1 );
412
407
0 commit comments