try and recover from panic?

This commit is contained in:
Evan Jarrett
2025-10-25 19:58:29 -05:00
parent 28ee948d0f
commit 6024953571
+10
View File
@@ -192,6 +192,11 @@ func (s *ManifestStore) Put(ctx context.Context, manifest distribution.Manifest,
// Do this asynchronously to avoid blocking the push
if tag != "" && s.ctx.ServiceToken != "" && s.ctx.Handle != "" {
go func() {
defer func() {
if r := recover(); r != nil {
slog.Error("Panic in notifyHoldAboutManifest", "panic", r)
}
}()
if err := s.notifyHoldAboutManifest(context.Background(), manifestRecord, tag, dgst.String()); err != nil {
slog.Warn("Failed to notify hold about manifest", "error", err)
}
@@ -201,6 +206,11 @@ func (s *ManifestStore) Put(ctx context.Context, manifest distribution.Manifest,
// Refresh README cache asynchronously if manifest has io.atcr.readme annotation
// This ensures fresh README content is available on repository pages
go func() {
defer func() {
if r := recover(); r != nil {
slog.Error("Panic in refreshReadmeCache", "panic", r)
}
}()
s.refreshReadmeCache(context.Background(), manifestRecord)
}()