fix(server-sdk): reconnect implemented

This commit is contained in:
Neko Ayaka
2025-03-21 11:42:39 +08:00
parent 900f72267b
commit f96cb55417
4 changed files with 165 additions and 54 deletions
+10 -1
View File
@@ -1,3 +1,4 @@
import process from 'node:process'
import { Format, LogLevel, setGlobalFormat, setGlobalLogLevel } from '@guiiai/logg'
import { Client } from '@proj-airi/server-sdk'
import { runUntilSignal } from '@proj-airi/server-sdk/utils/node'
@@ -6,9 +7,17 @@ setGlobalFormat(Format.Pretty)
setGlobalLogLevel(LogLevel.Log)
async function main() {
const _client = new Client<{ connectionString: string }>({ name: 'memory-pgvector' })
const client = new Client<{ connectionString: string }>({
name: 'memory-pgvector',
})
client.onEvent('module:configure', (_event) => {
})
runUntilSignal()
process.on('SIGINT', () => client.close())
process.on('SIGTERM', () => client.close())
}
main()