feat: add stable proactive delivery

This commit is contained in:
xmanrui 2026-08-30 11:24:53 +08:00
parent 410cb822d7
commit 31792d7bc8
88 changed files with 6427 additions and 488 deletions

View file

@ -9,13 +9,18 @@ export async function apply(ctx, config = {}) {
return installQqRpc(ctx, config.controller, config.rpcOptions, config.rpcAuthority);
}
const production = await createProductionController(ctx, config, config.internals);
const unregisterDelivery = config.deliveryService && production.deliveryAdapter
? config.deliveryService.registerAdapter(production.deliveryAdapter) : undefined;
const disposeRpc = installQqRpc(
ctx,
production.controller,
config.rpcOptions,
config.rpcAuthority,
);
ctx.effect(() => async () => production.close(), 'dsh-im: close QQ bot connections');
ctx.effect(() => async () => {
await unregisterDelivery?.();
await production.close();
}, 'dsh-im: close QQ bot connections');
return disposeRpc;
}