Adds debugfutures endpoint

This commit is contained in:
benbierens 2023-07-02 08:45:40 +02:00
parent a89938478a
commit 0004c5bc67
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
2 changed files with 10 additions and 1 deletions

View File

@ -297,6 +297,15 @@ proc initRestApi*(node: CodexNodeRef, conf: CodexConf): RestRouter =
return RestApiResponse.response($json, contentType="application/json")
router.api(
MethodGet,
"/api/codex/v1/debug/futures") do () -> RestApiResponse:
let count = pendingFuturesCount()
let json = %*{
"futures": $count
}
return RestApiResponse.response($json, contentType="application/json")
when codex_enable_api_debug_peers:
router.api(
MethodGet,

View File

@ -3,7 +3,7 @@ ARG BUILDER=ubuntu:lunar-20230415
ARG IMAGE=${BUILDER}
ARG BUILD_HOME=/src
ARG MAKE_PARALLEL=${MAKE_PARALLEL:-4}
ARG NIMFLAGS="${NIMFLAGS:-"-d:disableMarchNative"}"
ARG NIMFLAGS="${NIMFLAGS:-"-d:disableMarchNative -d:chronosFutureTracking -d:codex_enable_api_debug_peers=true"}"
ARG APP_HOME=/codex
ARG NAT_IP_AUTO=${NAT_IP_AUTO:-false}