Skip to content

Commit

Permalink
add warning about error equality
Browse files Browse the repository at this point in the history
  • Loading branch information
bnewbold committed Sep 28, 2024
1 parent a8f3a4e commit eb40574
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions atproto/identity/redisdir/redis_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ var _ identity.Directory = (*RedisDirectory)(nil)
// `redisURL` contains all the redis connection config options.
// `hitTTL` and `errTTL` define how long successful and errored identity metadata should be cached (respectively). errTTL is expected to be shorted than hitTTL.
// `lruSize` is the size of the in-process cache, for each of the handle and identity caches. 10000 is a reasonable default.
//
// NOTE: Errors returned may be inconsistent with the base directory, or between calls. This is because cached errors are serialized/deserialized and that may break equality checks.
func NewRedisDirectory(inner identity.Directory, redisURL string, hitTTL, errTTL, invalidHandleTTL time.Duration, lruSize int) (*RedisDirectory, error) {
opt, err := redis.ParseURL(redisURL)
if err != nil {
Expand Down

0 comments on commit eb40574

Please sign in to comment.