fix(publish): warn when distribution missing and resource key cannot be pre-registered

When b.Distribution is empty, the pre-registered resource key
U<storage>:<prefix>>><distribution> cannot be constructed, so
concurrent POST requests to the same prefix are not serialized by the
task queue.  Add a log warning so operators are aware of the gap.
This commit is contained in:
André Roth
2026-05-24 20:09:13 +00:00
parent 9e91ee4c4a
commit 9ecbc844e7
+3
View File
@@ -2,6 +2,7 @@ package api
import (
"fmt"
"log"
"net/http"
"strings"
@@ -307,6 +308,8 @@ func apiPublishRepoOrSnapshot(c *gin.Context) {
storagePrefix = storage + ":" + prefix
}
resources = append(resources, "U"+storagePrefix+">>"+b.Distribution)
} else {
log.Printf("distribution not specified for publish to prefix '%s' - unable to lock ", prefix)
}
taskName := fmt.Sprintf("Publish %s repository %s/%s with components \"%s\" and sources \"%s\"",