修改后端接口 outbox 和 信息同步 worker
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { initDatabase, closeDb } from './db/database'
|
||||
import { startWebSocketServer } from './transport/websocket'
|
||||
import { syncWorker } from './sync/worker'
|
||||
import { WorkflowEngine } from './workflow/engine'
|
||||
import { ToolRegistry, readFileTool } from './tools/registry'
|
||||
import type { AgentContext, LLMConfig, StreamCallbacks } from './types'
|
||||
@@ -32,9 +33,13 @@ function main() {
|
||||
const wss = startWebSocketServer(WS_PORT)
|
||||
console.log(`[core] WebSocket 端口: ${WS_PORT}`)
|
||||
|
||||
// 3. 启动云端同步 Worker(本地变更 → outbox → 云端推送;云端变更 → 拉取合并)
|
||||
syncWorker.start()
|
||||
|
||||
// 优雅退出
|
||||
process.on('SIGINT', () => {
|
||||
console.log('\n[core] 正在关闭...')
|
||||
syncWorker.stop()
|
||||
wss.close()
|
||||
closeDb()
|
||||
process.exit(0)
|
||||
|
||||
Reference in New Issue
Block a user