fix(web): clarify version timeout rationale
This commit is contained in:
parent
d600b9e3eb
commit
6c58b23946
1 changed files with 8 additions and 4 deletions
|
|
@ -43,9 +43,10 @@ func newSystemVersionCache() *systemVersionCache {
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// Reuse the launcher gateway startup window so embedded/slow devices
|
// 15 seconds matches the gateway startup window used elsewhere in launcher flow,
|
||||||
// have enough time for first-run command initialization.
|
// giving slow/embedded hosts enough time for first command invocation while
|
||||||
versionCmdTimeout = gatewayStartupWindow
|
// staying independent from cross-file init ordering.
|
||||||
|
versionCmdTimeout = 15 * time.Second
|
||||||
findPicoclawBinaryForInfo = utils.FindPicoclawBinary
|
findPicoclawBinaryForInfo = utils.FindPicoclawBinary
|
||||||
runPicoclawVersionOutput = executePicoclawVersion
|
runPicoclawVersionOutput = executePicoclawVersion
|
||||||
currentGatewayVersionState = gatewayVersionState
|
currentGatewayVersionState = gatewayVersionState
|
||||||
|
|
@ -64,7 +65,10 @@ func (h *Handler) handleGetVersion(w http.ResponseWriter, r *http.Request) {
|
||||||
versionInfo := h.resolveSystemVersionInfo(r.Context())
|
versionInfo := h.resolveSystemVersionInfo(r.Context())
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
json.NewEncoder(w).Encode(versionInfo)
|
if err := json.NewEncoder(w).Encode(versionInfo); err != nil {
|
||||||
|
http.Error(w, "Failed to encode response", http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// resolveSystemVersionInfo prefers the actual picoclaw binary version output,
|
// resolveSystemVersionInfo prefers the actual picoclaw binary version output,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue