From 1b5b2141dd6143a263fdff89b25fb6b2cbc693b8 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 24 Nov 2024 02:40:11 +0800 Subject: [PATCH] refactor: add prune script --- apps/cli/src/commands/system/prune.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 apps/cli/src/commands/system/prune.ts diff --git a/apps/cli/src/commands/system/prune.ts b/apps/cli/src/commands/system/prune.ts new file mode 100644 index 00000000000..ce0044d5326 --- /dev/null +++ b/apps/cli/src/commands/system/prune.ts @@ -0,0 +1,23 @@ +import { CommandModule } from 'yargs'; +import { TcBroker } from 'tailchat-server-sdk'; +import defaultBrokerConfig from 'tailchat-server-sdk/dist/runner/moleculer.config'; +import { config } from 'dotenv'; + +export const pruneCommand: CommandModule = { + command: 'prune', + describe: 'Remove outdate data', + builder: undefined, + async handler(args) { + config(); + + // TODO: search all outdate data + + // TODO: Call file service to remove them + + // const broker = new TcBroker({ + // ...defaultBrokerConfig, + // transporter: process.env.TRANSPORTER, + // }); + // await broker.start(); + }, +};