retry last page just in case

This commit is contained in:
Robin Appelman 2017-06-16 17:31:07 +02:00
commit 144d03e1e2

View file

@ -13,8 +13,8 @@ $statePath = getenv('STATE_FILE');
if (file_exists($statePath)) {
$lastPage = intval(file_get_contents($statePath));
if (!$lastPage) {
$lastPage = intval(file_get_contents($statePath)) - 1;
if ($lastPage < 1) {
$lastPage = 1;
}
} else {
@ -24,4 +24,4 @@ $backup = new \Demostf\Backup\Backup($source, $store);
$currentPage = $backup->backupFrom($lastPage);
file_put_contents($statePath, $currentPage);
file_put_contents($statePath, $currentPage);