@@ -750,8 +750,7 @@ func (rc *RedisDB) SetRepoReference(ctx context.Context, repo string,
750
750
return err
751
751
}
752
752
753
- locks := []string {rc .getImageLockKey (imageMeta .Digest .String ()), rc .getRepoLockKey (repo )}
754
- err = rc .withRSLocks (ctx , locks , func () error {
753
+ err = rc .withRSLocks (ctx , []string {rc .getImageLockKey (imageMeta .Digest .String ())}, func () error {
755
754
err := rc .Client .HSet (ctx , rc .ImageMetaKey , imageMeta .Digest .String (), imageMetaBlob ).Err ()
756
755
if err != nil {
757
756
rc .Log .Error ().Err (err ).Str ("hset" , rc .ImageMetaKey ).Str ("digest" , imageMeta .Digest .String ()).
@@ -760,6 +759,13 @@ func (rc *RedisDB) SetRepoReference(ctx context.Context, repo string,
760
759
return fmt .Errorf ("failed to set image meta record for digest %s: %w" , imageMeta .Digest .String (), err )
761
760
}
762
761
762
+ return nil
763
+ })
764
+ if err != nil {
765
+ return err
766
+ }
767
+
768
+ err = rc .withRSLocks (ctx , []string {rc .getRepoLockKey (repo )}, func () error {
763
769
protoRepoMeta , err := rc .getProtoRepoMeta (ctx , repo )
764
770
if err != nil && ! errors .Is (err , zerr .ErrRepoMetaNotFound ) {
765
771
return err
@@ -1805,8 +1811,7 @@ if there are no tags pointing to the digest, otherwise it's noop.
1805
1811
func (rc * RedisDB ) RemoveRepoReference (repo , reference string , manifestDigest godigest.Digest ) error {
1806
1812
ctx := context .Background ()
1807
1813
1808
- locks := []string {rc .getImageLockKey (manifestDigest .String ()), rc .getRepoLockKey (repo )}
1809
- err := rc .withRSLocks (ctx , locks , func () error {
1814
+ err := rc .withRSLocks (ctx , []string {rc .getRepoLockKey (repo )}, func () error {
1810
1815
protoRepoMeta , err := rc .getProtoRepoMeta (ctx , repo )
1811
1816
if err != nil {
1812
1817
if errors .Is (err , zerr .ErrRepoMetaNotFound ) {
0 commit comments