Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ident: have redis caching dir only log on 'write', not error #809

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 31 additions & 15 deletions atproto/identity/redisdir/redis_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"log/slog"
"sync"
"time"

Expand Down Expand Up @@ -116,9 +117,12 @@ func (d *RedisDirectory) updateHandle(ctx context.Context, h syntax.Handle) hand
TTL: d.ErrTTL,
})
if err != nil {
he.DID = nil
he.Err = fmt.Errorf("identity cache write: %w", err)
return he
/*
he.DID = nil
he.Err = fmt.Errorf("identity cache write: %w", err)
return he
*/
slog.Error("identity cache write", "cache", "handle", "err", err)
}
return he
}
Expand All @@ -141,9 +145,12 @@ func (d *RedisDirectory) updateHandle(ctx context.Context, h syntax.Handle) hand
TTL: d.HitTTL,
})
if err != nil {
he.DID = nil
he.Err = fmt.Errorf("identity cache write: %w", err)
return he
/*
he.DID = nil
he.Err = fmt.Errorf("identity cache write: %w", err)
return he
*/
slog.Error("identity cache write", "cache", "did", "did", ident.DID, "err", err)
}
err = d.handleCache.Set(&cache.Item{
Ctx: ctx,
Expand All @@ -152,9 +159,12 @@ func (d *RedisDirectory) updateHandle(ctx context.Context, h syntax.Handle) hand
TTL: d.HitTTL,
})
if err != nil {
he.DID = nil
he.Err = fmt.Errorf("identity cache write: %w", err)
return he
/*
he.DID = nil
he.Err = fmt.Errorf("identity cache write: %w", err)
return he
*/
slog.Error("identity cache write", "cache", "handle", "did", ident.DID, "err", err)
}
return he
}
Expand Down Expand Up @@ -250,9 +260,12 @@ func (d *RedisDirectory) updateDID(ctx context.Context, did syntax.DID) identity
TTL: d.HitTTL,
})
if err != nil {
entry.Identity = nil
entry.Err = fmt.Errorf("identity cache write: %v", err)
return entry
/*
entry.Identity = nil
entry.Err = fmt.Errorf("identity cache write: %v", err)
return entry
*/
slog.Error("identity cache write", "cache", "did", "did", did, "err", err)
}
if he != nil {
err = d.handleCache.Set(&cache.Item{
Expand All @@ -262,9 +275,12 @@ func (d *RedisDirectory) updateDID(ctx context.Context, did syntax.DID) identity
TTL: d.HitTTL,
})
if err != nil {
entry.Identity = nil
entry.Err = fmt.Errorf("identity cache write: %v", err)
return entry
/*
entry.Identity = nil
entry.Err = fmt.Errorf("identity cache write: %v", err)
return entry
*/
slog.Error("identity cache write", "cache", "handle", "did", did, "err", err)
}
}
return entry
Expand Down
Loading