Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1c394c5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix issue where train files would not be deleted past TTL or when over file number limit."

parents ac6a498e 981069af
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -690,14 +690,16 @@ void StorageManager::trimToFit(const char* path, bool parseTimestampOnly) {
        if (name[0] == '.') continue;

        FileName output;
        string file_name;
        if (parseTimestampOnly) {
            file_name = StringPrintf("%s/%s", path, name);
            output.mTimestampSec = StrToInt64(strtok(name, "_"));
            output.mIsHistory = false;
        } else {
            parseFileName(name, &output);
            file_name = output.getFullFileName(path);
        }
        if (output.mTimestampSec == -1) continue;
        string file_name = output.getFullFileName(path);

        // Check for timestamp and delete if it's too old.
        long fileAge = nowSec - output.mTimestampSec;