feat(server): outbox relay 改为 LISTEN/NOTIFY + 30s 兜底轮询

- EventBus::publish() 持久化后执行 NOTIFY outbox_channel
- outbox relay 使用 sqlx::PgListener 监听 + tokio::select! 竞争
- 30s 兜底轮询防止 NOTIFY 丢失,断线自动重连
- 轮询间隔从 5s 提升到 30s,事件延迟降至 <100ms
This commit is contained in:
iven
2026-04-27 17:50:38 +08:00
parent 8d55d98f4f
commit d31d7beb1f
5 changed files with 79 additions and 10 deletions

View File

@@ -17,6 +17,7 @@ tracing.workspace = true
tracing-subscriber.workspace = true
config.workspace = true
sea-orm.workspace = true
sqlx.workspace = true
redis.workspace = true
utoipa.workspace = true
serde_json.workspace = true