Skip to content

[bug] Redis connection closes after calling /souin-api/souin/flush #752

@IndraGunawan

Description

@IndraGunawan

When I call the flush API, the next request fails to write to Redis.

I got these errors:

  • Header: Cache-Status: Souin; fwd=uri-miss; detail=REDIS-INSERTION-ERROR
  • Log: ERROR storages.cache.redis Impossible to set value into Redis, rueidis client is closing or unable to connect redis

I checked that right after calling DeleteMany to storer, there is additional s.surrogateStorage.Destruct() (https://github.com/darkweak/souin/blob/master/pkg/api/souin.go#L315) which calls Storage.Reset() (https://github.com/darkweak/souin/blob/master/pkg/surrogate/providers/common.go#L308-L310) which calls Provider.Close() (https://github.com/darkweak/storages/blob/main/redis/redis.go#L281-L287)

Is there something missing in the Destruct logic? It feels like this method is currently doing a "hard shutdown"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions