Files
Oxicloud/tools/perf-audit/video-thumbnail-server-cli.mjs
T

23 lines
576 B
JavaScript
Raw Normal View History

2026-07-22 02:06:04 +02:00
#!/usr/bin/env node
import { startVideoThumbnailServer } from "./video-thumbnail-server.mjs";
const fixturePath = process.argv[2] ?? "/tmp/oxicloud-thumbnail-perf.webm";
const server = await startVideoThumbnailServer({ fixturePath });
console.log(
JSON.stringify({ url: server.url, fixtureBytes: server.fixtureBytes }),
);
let closing = false;
async function close() {
if (closing) return;
closing = true;
await server.close();
process.exit(0);
}
process.on("SIGINT", () => void close());
process.on("SIGTERM", () => void close());
await new Promise(() => {});