mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-30 15:22:07 +00:00
This commit is contained in:
parent
1026e25f33
commit
c9547f4fba
3 changed files with 7 additions and 3 deletions
|
@ -262,7 +262,7 @@ func MustRemoveTemporaryDirs(dir string) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
dirName := fi.Name()
|
dirName := fi.Name()
|
||||||
if strings.Contains(dirName, ".must-remove.") {
|
if IsScheduledForRemoval(dirName) {
|
||||||
fullPath := dir + "/" + dirName
|
fullPath := dir + "/" + dirName
|
||||||
MustRemoveAll(fullPath)
|
MustRemoveAll(fullPath)
|
||||||
}
|
}
|
||||||
|
@ -467,3 +467,7 @@ func isHTTPURL(targetURL string) bool {
|
||||||
return err == nil && (parsed.Scheme == "http" || parsed.Scheme == "https") && parsed.Host != ""
|
return err == nil && (parsed.Scheme == "http" || parsed.Scheme == "https") && parsed.Host != ""
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsScheduledForRemoval(name string) bool {
|
||||||
|
return strings.Contains(name, ".must-remove.")
|
||||||
|
}
|
||||||
|
|
|
@ -1835,5 +1835,5 @@ func removeParts(pws []*partWrapper, partsToRemove map[*partWrapper]bool) ([]*pa
|
||||||
func isSpecialDir(name string) bool {
|
func isSpecialDir(name string) bool {
|
||||||
// Snapshots and cache dirs aren't used anymore.
|
// Snapshots and cache dirs aren't used anymore.
|
||||||
// Keep them here for backwards compatibility.
|
// Keep them here for backwards compatibility.
|
||||||
return name == "tmp" || name == "txn" || name == "snapshots" || name == "cache"
|
return name == "tmp" || name == "txn" || name == "snapshots" || name == "cache" || fs.IsScheduledForRemoval(name)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2022,7 +2022,7 @@ func (pt *partition) createSnapshot(srcDir, dstDir string) error {
|
||||||
// Skip non-directories.
|
// Skip non-directories.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if fn == "tmp" || fn == "txn" {
|
if fn == "tmp" || fn == "txn" || fs.IsScheduledForRemoval(fn) {
|
||||||
// Skip special dirs.
|
// Skip special dirs.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue