Compare commits

...

1 commit

Author SHA1 Message Date
745c9be4c9 [#598] Hold mode mutex when setting mode
Some checks failed
DCO action / DCO (pull_request) Successful in 4m38s
Vulncheck / Vulncheck (pull_request) Successful in 4m11s
Build / Build Components (1.21) (pull_request) Successful in 5m14s
Tests and linters / Lint (pull_request) Successful in 5m45s
Tests and linters / Staticcheck (pull_request) Successful in 6m7s
Build / Build Components (1.20) (pull_request) Successful in 6m55s
Tests and linters / Tests (1.21) (pull_request) Failing after 13m29s
Tests and linters / Tests with -race (pull_request) Failing after 13m52s
Tests and linters / Tests (1.20) (pull_request) Successful in 15m18s
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-08-11 16:43:23 +03:00
2 changed files with 6 additions and 0 deletions

View file

@ -22,6 +22,9 @@ func (c *cache) SetMode(m mode.Mode) error {
))
defer span.End()
c.modeMtx.Lock()
defer c.modeMtx.Unlock()
err := c.setMode(ctx, m)
if err == nil {
c.metrics.SetMode(m)

View file

@ -22,6 +22,9 @@ func (c *cache) SetMode(m mode.Mode) error {
))
defer span.End()
c.modeMtx.Lock()
defer c.modeMtx.Unlock()
err := c.setMode(ctx, m)
if err == nil {
c.metrics.SetMode(m)