Skip to content

Commit

Permalink
Merge pull request #1 from ARPA-SIMC/check-archive-delete-not-empty
Browse files Browse the repository at this point in the history
Fixed CheckAge check on archive and delete age
  • Loading branch information
brancomat committed Oct 14, 2015
2 parents 7ee56b8 + 9175817 commit 43d56a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arki/dataset/ondisk2/writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,12 @@ void CheckAge::operator()(const std::string& file, data::FileState state)
{
string maxdate = idx.max_file_reftime(file);
//cerr << "TEST " << maxdate << " WITH " << delete_threshold << " AND " << archive_threshold << endl;
if (delete_threshold >= maxdate)
if (not delete_threshold.empty() && delete_threshold >= maxdate)
{
nag::verbose("CheckAge: %s is old enough to be deleted", file.c_str());
next(file, state + FILE_TO_DELETE);
}
else if (archive_threshold >= maxdate)
else if (not archive_threshold.empty() && archive_threshold >= maxdate)
{
nag::verbose("CheckAge: %s is old enough to be archived", file.c_str());
next(file, state + FILE_TO_ARCHIVE);
Expand Down

0 comments on commit 43d56a3

Please sign in to comment.