feat: use postgres
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user