You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: filestorage.go
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,6 @@ import (
21
21
"fmt"
22
22
"io"
23
23
"io/fs"
24
-
"log"
25
24
"os"
26
25
"path"
27
26
"path/filepath"
@@ -213,7 +212,7 @@ func (s *FileStorage) Lock(ctx context.Context, name string) error {
213
212
// the previous acquirer either crashed or had some sort of failure that
214
213
// caused them to be unable to fully acquire or retain the lock, therefore
215
214
// we should treat it as if the lockfile did not exist
216
-
log.Printf("[INFO][%s] %s: Empty lockfile (%v) - likely previous process crashed or storage medium failure; treating as stale", s, filename, err2)
215
+
defaultLogger.Sugar().Infof("[%s] %s: Empty lockfile (%v) - likely previous process crashed or storage medium failure; treating as stale", s, filename, err2)
@@ -235,8 +234,7 @@ func (s *FileStorage) Lock(ctx context.Context, name string) error {
235
234
// either have potential to cause infinite loops, as in caddyserver/caddy#4448,
236
235
// or must give up on perfect mutual exclusivity; however, these cases are rare,
237
236
// so we prefer the simpler solution that avoids infinite loops)
238
-
log.Printf("[INFO][%s] Lock for '%s' is stale (created: %s, last update: %s); removing then retrying: %s",
239
-
s, name, meta.Created, meta.Updated, filename)
237
+
defaultLogger.Sugar().Infof("[%s] Lock for '%s' is stale (created: %s, last update: %s); removing then retrying: %s", s, name, meta.Created, meta.Updated, filename)
240
238
iferr=os.Remove(filename); err!=nil { // hopefully we can replace the lock file quickly!
241
239
if!errors.Is(err, fs.ErrNotExist) {
242
240
returnfmt.Errorf("unable to delete stale lockfile; deadlocked: %w", err)
0 commit comments