Add timeout to curl

This commit is contained in:
Kenneth Bruen 2024-02-21 19:08:30 +01:00
parent 29ad865fa6
commit 571de3b24e
Signed by: kbruen
GPG key ID: C1980A470C3EE5B1
2 changed files with 4 additions and 0 deletions

View file

@ -65,6 +65,8 @@ fn fetchThread(state: *AppState) !void {
defer result.deinit();
_ = curl.setopt(.write_function, Curl.Utils.array_list_append);
_ = curl.setopt(.write_data, &result);
_ = curl.setopt(.low_speed_limit, @as(c_long, 128));
_ = curl.setopt(.low_speed_time, @as(c_long, 5));
const code = curl.perform();
std.debug.print("[departure/fetchThread] cURL Code: {}\n", .{code});

View file

@ -44,6 +44,8 @@ fn fetchThread(state: *AppState) !void {
defer result.deinit();
_ = curl.setopt(.write_function, Curl.Utils.array_list_append);
_ = curl.setopt(.write_data, &result);
_ = curl.setopt(.low_speed_limit, @as(c_long, 128));
_ = curl.setopt(.low_speed_time, @as(c_long, 5));
const code = curl.perform();
std.debug.print("[home/fetchThread] cURL Code: {}\n", .{code});