mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
This commit is contained in:
parent
a2340e6c95
commit
d8eaa511b0
3 changed files with 7 additions and 3 deletions
|
@ -262,7 +262,7 @@ func MustRemoveTemporaryDirs(dir string) {
|
|||
continue
|
||||
}
|
||||
dirName := fi.Name()
|
||||
if strings.Contains(dirName, ".must-remove.") {
|
||||
if IsScheduledForRemoval(dirName) {
|
||||
fullPath := dir + "/" + dirName
|
||||
MustRemoveAll(fullPath)
|
||||
}
|
||||
|
@ -467,3 +467,7 @@ func isHTTPURL(targetURL string) bool {
|
|||
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 {
|
||||
// Snapshots and cache dirs aren't used anymore.
|
||||
// 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.
|
||||
continue
|
||||
}
|
||||
if fn == "tmp" || fn == "txn" {
|
||||
if fn == "tmp" || fn == "txn" || fs.IsScheduledForRemoval(fn) {
|
||||
// Skip special dirs.
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue