feat: use postgres

This commit is contained in:
Ilia Denisov
2026-04-26 20:34:39 +02:00
committed by GitHub
parent 48b0056b49
commit fe829285a6
365 changed files with 29223 additions and 24049 deletions
+7 -5
View File
@@ -304,9 +304,10 @@ func optionalRawString(values map[string]any, key string) string {
return value
}
// Shutdown stops the command consumer within ctx. The consumer uses the
// shared process Redis client and therefore has no dedicated resources to
// release here.
// Shutdown stops the command consumer within ctx. The consumer borrows the
// shared process Redis client and forcibly closes it during Shutdown so the
// in-flight blocking XREAD returns immediately; the runtime owns the same
// client and its cleanupFn is tolerant of ErrClosed.
func (consumer *CommandConsumer) Shutdown(ctx context.Context) error {
if ctx == nil {
return errors.New("shutdown command consumer: nil context")
@@ -318,9 +319,10 @@ func (consumer *CommandConsumer) Shutdown(ctx context.Context) error {
var err error
consumer.closeOnce.Do(func() {
if consumer.client != nil {
err = consumer.client.Close()
if cerr := consumer.client.Close(); cerr != nil && !errors.Is(cerr, redis.ErrClosed) {
err = cerr
}
}
})
return err
}