feat(automation): add scheduled minio memory sync jobs

This commit is contained in:
William Valentin
2026-02-16 14:25:18 -08:00
parent 22f225998f
commit 21c986b671
10 changed files with 384 additions and 3 deletions
+1 -1
View File
@@ -200,7 +200,7 @@ export async function startDaemon(config: Config, options?: StartDaemonOptions):
}
// ── Lifecycle ──
await startServices({ config, lifecycle, channelRegistry, gateway, modelRouter, memoryDir, dataDir });
await startServices({ config, lifecycle, channelRegistry, gateway, modelRouter, memoryStore, memoryDir, dataDir });
const backupScheduler = new BackupScheduler({
dataDir,
backupConfig: config.backup,
+16 -2
View File
@@ -8,7 +8,7 @@ import { ModelRouter } from '../models/index.js';
import { SessionManager } from '../session/index.js';
import { GatewayServer } from '../gateway/index.js';
import { ChannelRegistry, PairingManager, type PairingStore } from '../channels/index.js';
import { HeartbeatMonitor } from '../automation/index.js';
import { HeartbeatMonitor, MinioSyncScheduler } from '../automation/index.js';
import { McpManager } from '../mcp/index.js';
import {
SkillRegistry,
@@ -430,10 +430,11 @@ export async function startServices(deps: {
channelRegistry: ChannelRegistry;
gateway: GatewayServer;
modelRouter: ModelRouter;
memoryStore?: MemoryStore;
memoryDir: string;
dataDir: string;
}): Promise<void> {
const { config, lifecycle, channelRegistry, gateway, modelRouter, memoryDir, dataDir } = deps;
const { config, lifecycle, channelRegistry, gateway, modelRouter, memoryStore, memoryDir, dataDir } = deps;
// Register shutdown handler for channels
lifecycle.onShutdown(async () => {
@@ -489,6 +490,19 @@ export async function startServices(deps: {
console.log('Heartbeat monitor stopped');
});
const minioSyncScheduler = new MinioSyncScheduler({
config: config.automation.minio_sync,
backupConfig: config.backup,
memoryStore,
channelLookup: channelRegistry,
});
minioSyncScheduler.start();
lifecycle.onShutdown(async () => {
minioSyncScheduler.stop();
console.log('MinIO sync scheduler stopped');
});
// Signal handlers
const signalHandler = () => {
lifecycle.shutdown().then(() => process.exit(0));