mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
lib/fs: add canOverwrite arg to WriteFileAtomically when it is allowed to overwrite the file atomically if it already exists
This commit is contained in:
@@ -211,7 +211,7 @@ func tryOpeningQueue(path, name string, chunkFileSize, maxBlockSize, maxPendingB
|
||||
|
||||
// Create initial chunk file.
|
||||
filepath := q.chunkFilePath(0)
|
||||
if err := fs.WriteFileAtomically(filepath, nil); err != nil {
|
||||
if err := fs.WriteFileAtomically(filepath, nil, false); err != nil {
|
||||
return nil, fmt.Errorf("cannot create %q: %w", filepath, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user