Skip to content

Commit

Permalink
dird: cats: stop file purge if there are no eligible jobids
Browse files Browse the repository at this point in the history
  • Loading branch information
alaaeddineelamri committed Jul 18, 2023
1 parent d7cea1c commit 01b6b2d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/cats/sql_delete.cc
Expand Up @@ -202,6 +202,11 @@ bool BareosDb::DeleteMediaRecord(JobControlRecord* jcr, MediaDbRecord* mr)

void BareosDb::PurgeFiles(const char* jobids)
{
if (strcmp(jobids, "") == 0) {
Dmsg0(100, "No jobids to use for purging files\n");
return;
}

PoolMem query(PM_MESSAGE);

Mmsg(query, "DELETE FROM File WHERE JobId IN (%s)", jobids);
Expand Down

0 comments on commit 01b6b2d

Please sign in to comment.