Recover background chat observers from durable live membership
This commit is contained in:
@@ -134,9 +134,6 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
|
||||
// session; resume delivering any a previous process left queued.
|
||||
hub.queueStore = stores[0]
|
||||
hub.liveStore = stores[0]
|
||||
if options.Chat != nil {
|
||||
go hub.resumeQueued(ctx, options.Chat)
|
||||
}
|
||||
}
|
||||
acks := newAttentionAckHub()
|
||||
var ackStore attentionAckStore
|
||||
@@ -500,9 +497,15 @@ func HandlerWithOptions(ctx context.Context, options Options, stores ...*pipelin
|
||||
// that ended while it was down), then keep observing any other chat
|
||||
// whose turn is still running, so a reply or question still notifies
|
||||
// with no client attached.
|
||||
done := make(chan struct{})
|
||||
hub.recoveryDone = done
|
||||
go func() {
|
||||
hub.reattachSessions(ctx, options.Chat)
|
||||
// Restore live turn ownership before queue rooms can start runners.
|
||||
hub.resumeQueued(ctx, options.Chat)
|
||||
hub.observeRunningTurns(ctx, options.Chat)
|
||||
close(done)
|
||||
hub.retryReattachments(ctx, options.Chat)
|
||||
}()
|
||||
}
|
||||
if runs != nil {
|
||||
|
||||
Reference in New Issue
Block a user