mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 15:50:46 +00:00
fix: stabilize qa lab capture store cleanup
This commit is contained in:
@@ -113,6 +113,10 @@ const captureMock = vi.hoisted(() => {
|
||||
});
|
||||
|
||||
vi.mock("openclaw/plugin-sdk/proxy-capture", () => ({
|
||||
acquireDebugProxyCaptureStore: () => ({
|
||||
store: captureMock.store,
|
||||
release: captureMock.store.close,
|
||||
}),
|
||||
getDebugProxyCaptureStore: () => captureMock.store,
|
||||
resolveDebugProxySettings: () => ({
|
||||
dbPath: process.env.OPENCLAW_DEBUG_PROXY_DB_PATH ?? "",
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createServer, type IncomingMessage } from "node:http";
|
||||
import path from "node:path";
|
||||
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
||||
import {
|
||||
getDebugProxyCaptureStore,
|
||||
acquireDebugProxyCaptureStore,
|
||||
resolveDebugProxySettings,
|
||||
} from "openclaw/plugin-sdk/proxy-capture";
|
||||
import { closeQaHttpServer, handleQaBusRequest, writeError, writeJson } from "./bus-server.js";
|
||||
@@ -168,7 +168,11 @@ export async function startQaLabServer(
|
||||
): Promise<QaLabServerHandle> {
|
||||
const repoRoot = path.resolve(params?.repoRoot ?? process.cwd());
|
||||
const captureSettings = resolveDebugProxySettings();
|
||||
const captureStore = getDebugProxyCaptureStore(captureSettings.dbPath, captureSettings.blobDir);
|
||||
const captureStoreLease = acquireDebugProxyCaptureStore(
|
||||
captureSettings.dbPath,
|
||||
captureSettings.blobDir,
|
||||
);
|
||||
const captureStore = captureStoreLease.store;
|
||||
const state = createQaBusState();
|
||||
let latestReport: QaLabLatestReport | null = null;
|
||||
let latestScenarioRun: QaLabScenarioRun | null = null;
|
||||
@@ -639,7 +643,7 @@ export async function startQaLabServer(
|
||||
await runnerModelCatalogPromise?.catch(() => undefined);
|
||||
await gateway?.stop();
|
||||
await closeQaHttpServer(server);
|
||||
captureStore.close();
|
||||
captureStoreLease.release();
|
||||
},
|
||||
};
|
||||
labHandle = lab;
|
||||
|
||||
Reference in New Issue
Block a user