Skip to content

Commit

Permalink
Merge pull request #779 from otherpaco/cleanup-cache
Browse files Browse the repository at this point in the history
clear the backup-size cache (fixes #776)
  • Loading branch information
freekmurze committed Oct 29, 2018
2 parents fc5aa95 + 95e166d commit 0aaed02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/BackupDestination/BackupDestination.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,11 @@ public function newestBackupIsOlderThan(Carbon $date): bool

return $newestBackup->date()->gt($date);
}

public function fresh(): self
{
$this->backupCollectionCache = null;

return $this;
}
}
2 changes: 1 addition & 1 deletion src/Tasks/Cleanup/CleanupJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function run()
$this->strategy->deleteOldBackups($backupDestination->backups());
$this->sendNotification(new CleanupWasSuccessful($backupDestination));

$usedStorage = Format::humanReadableSize($backupDestination->usedStorage());
$usedStorage = Format::humanReadableSize($backupDestination->fresh()->usedStorage());
consoleOutput()->info("Used storage after cleanup: {$usedStorage}.");
} catch (Exception $exception) {
consoleOutput()->error("Cleanup failed because: {$exception->getMessage()}.");
Expand Down

0 comments on commit 0aaed02

Please sign in to comment.