config: add proxy_timeout_sec

This commit is contained in:
Vaxry
2025-04-12 23:13:11 +01:00
parent 7bfb4cdb84
commit 7e348baf8c
3 changed files with 13 additions and 9 deletions

View File

@@ -296,7 +296,7 @@ void CServerHandler::proxyPass(const Pistache::Http::Request& req, Pistache::Htt
Debug::log(LOG, "Header in: {}: {}", h->name(), req.headers().getRaw(h->name()).value());
builder.header(h);
}
builder.timeout(std::chrono::milliseconds(10000));
builder.timeout(std::chrono::seconds(g_pConfig->m_config.proxy_timeout_sec));
// TODO: implement streaming for git's large objects?
@@ -329,7 +329,7 @@ void CServerHandler::proxyPass(const Pistache::Http::Request& req, Pistache::Htt
response.send(Pistache::Http::Code::Internal_Server_Error, "Internal Proxy Error");
});
Pistache::Async::Barrier<Pistache::Http::Response> b(resp);
b.wait_for(std::chrono::seconds(10));
b.wait_for(std::chrono::seconds(g_pConfig->m_config.proxy_timeout_sec));
client.shutdown();
}