Ignore .nomedia file in statisitcs and flle gc.
GitOrigin-RevId: 2b1ab488b4686563d4d7368261c784c8cd7ad691
This commit is contained in:
parent
d494a3e13f
commit
7776513651
@ -110,7 +110,7 @@ void FileGcWorker::run_gc(const FileGcParameters ¶meters, std::vector<FullFi
|
||||
return true;
|
||||
}
|
||||
if (static_cast<double>(info.mtime_nsec / 1000000000) > now - parameters.immunity_delay) {
|
||||
// new files are immune to gc.
|
||||
// new files are immune to gc
|
||||
time_immunity_ignored_cnt++;
|
||||
new_stats.add(FullFileInfo(info));
|
||||
return true;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "td/utils/format.h"
|
||||
#include "td/utils/logging.h"
|
||||
#include "td/utils/misc.h"
|
||||
#include "td/utils/PathView.h"
|
||||
#include "td/utils/port/path.h"
|
||||
#include "td/utils/port/Stat.h"
|
||||
@ -115,6 +116,11 @@ Status scan_fs(CallbackT &&callback) {
|
||||
return;
|
||||
}
|
||||
auto stat = r_stat.move_as_ok();
|
||||
if (ends_with(path, "/.nomedia") && stat.size_ == 0) {
|
||||
// skip .nomedia file
|
||||
return;
|
||||
}
|
||||
|
||||
FsFileInfo info;
|
||||
info.path = path.str();
|
||||
info.size = stat.size_;
|
||||
|
Loading…
Reference in New Issue
Block a user