mirror of
https://github.com/suchmememanyskill/CYD-Klipper.git
synced 2026-03-21 05:33:24 +00:00
Set timeout for getting files
This commit is contained in:
3
CYD-Klipper/.vscode/settings.json
vendored
3
CYD-Klipper/.vscode/settings.json
vendored
@@ -10,6 +10,7 @@
|
|||||||
"string_view": "cpp",
|
"string_view": "cpp",
|
||||||
"initializer_list": "cpp",
|
"initializer_list": "cpp",
|
||||||
"algorithm": "cpp",
|
"algorithm": "cpp",
|
||||||
"cstddef": "cpp"
|
"cstddef": "cpp",
|
||||||
|
"functional": "cpp"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,6 +31,7 @@ FILESYSTEM_FILE* get_files(int limit){
|
|||||||
sprintf(buff, "http://%s:%d/server/files/list", global_config.klipperHost, global_config.klipperPort);
|
sprintf(buff, "http://%s:%d/server/files/list", global_config.klipperHost, global_config.klipperPort);
|
||||||
HTTPClient client;
|
HTTPClient client;
|
||||||
client.useHTTP10(true);
|
client.useHTTP10(true);
|
||||||
|
client.setTimeout(5000);
|
||||||
client.begin(buff);
|
client.begin(buff);
|
||||||
int httpCode = client.GET();
|
int httpCode = client.GET();
|
||||||
auto timer_parse = millis();
|
auto timer_parse = millis();
|
||||||
|
|||||||
Reference in New Issue
Block a user