Added manticore sync all tool, updated manticore driver.

This commit is contained in:
2026-11-12 02:18:13 +01:00
parent de05075def
commit f5e3a8a2ae
7 changed files with 175 additions and 151 deletions
+19
View File
@@ -0,0 +1,19 @@
import process from 'node:process';
import { knexOwner as knex } from '../src/knex.js';
import redis from '../src/redis.js';
// runs a command line tool and closes the connections afterwards, the knex pool and redis would otherwise keep the process alive
export default async function runTool(tool) {
try {
await tool();
await knex.destroy();
await redis.quit();
}
catch (error) {
// the manticore client rejects with a plain response object rather than an Error, print the server's message
console.error(error instanceof Error ? error : error?.body?.error || error?.body || error);
process.exit(1);
}
}