Compare commits

..

1 Commits

Author SHA1 Message Date
bagas 53cc5c2328 fix(registry): data race when updating slug
Docker Build and Push / Run Tests (push) Successful in 2m33s
Tests / Run Tests (pull_request) Successful in 2m27s
Docker Build and Push / Build and Push Docker Image (push) Successful in 14m51s
2026-07-19 10:54:26 +07:00
+3 -3
View File
@@ -94,13 +94,13 @@ func (r *registry) Update(user string, oldKey, newKey Key) error {
return ErrInvalidSlug
}
r.mu.Lock()
defer r.mu.Unlock()
if _, exists := r.slugIndex[newKey]; exists && newKey != oldKey {
return ErrSlugInUse
}
r.mu.Lock()
defer r.mu.Unlock()
client, ok := r.byUser[user][oldKey]
if !ok {
return ErrSessionNotFound