Catch a denied publish at once instead of waiting it out, so an ungranted bucket's refusal names it (issue 1188, review round 1 finding 1)

This commit is contained in:
jochen
2026-10-19 04:48:58 +02:00
parent 80d3975762
commit e05e7130ae
5 changed files with 133 additions and 23 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ func (c *Conn) Ask(bucket, id string) (*stdio.StateEntry, error) {
return nil, err
}
subject := "$JS.API.DIRECT.GET.KV_" + bucket + ".$KV." + bucket + "." + c.account.Module + "." + id
ctx, cancel := context.WithTimeout(context.Background(), StateTimeout)
ctx, cancel := context.WithTimeout(context.Background(), stateTimeout)
defer cancel()
reply, err := c.nc.RequestWithContext(ctx, subject, nil)
if err != nil {