You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function backup_date() does not create the backup under the following conditions:
there's no previous backup made;
timestamp of file to be backed up is the same as the one when we try to make the backup;
Diagnostic
The issue seems to be caused by code in 'DirectoryQueue.R', function/method should_rotate(), line 601. In case there's no backup, self$last_rotation returns NULL and the following line of code
if (is.null(last_rotation))
return(TRUE)
seems to indicate that the intended behavior is to create backup in such case.
However, the code in line 601: last_rotation = self$last_rotation %||% file.info(self$origin)$ctime
results that last_rotation assumes the value of the timestamp of the file to be backed up and if that date is the same of the current day then the backup is never made. The code in line 601 makes me doubt what is in fact the intended behavior under the conditions listed above.
Suggestion
In my opinion, under those conditions the backup should be made.
The text was updated successfully, but these errors were encountered:
Thanks for the report. I vaguely remember looking into that behaviour and not coming to a better solution.
The behaviour is the way it is because backup and rotate should behave consistently, and for rotate it makes much more sense to do it the way it is now. (rotate is also the main function of the package, and backup is just a "free" extra).
I understand how this might be slightly confusing, and I'll look into it again when I get the chance (maybe an additional argument), but I'm not sure I'll come up with something :(
Issue
Function
backup_date()
does not create the backup under the following conditions:Diagnostic
The issue seems to be caused by code in 'DirectoryQueue.R', function/method
should_rotate()
, line 601. In case there's no backup,self$last_rotation
returns NULL and the following line of codeseems to indicate that the intended behavior is to create backup in such case.
However, the code in line 601:
last_rotation = self$last_rotation %||% file.info(self$origin)$ctime
results that last_rotation assumes the value of the timestamp of the file to be backed up and if that date is the same of the current day then the backup is never made. The code in line 601 makes me doubt what is in fact the intended behavior under the conditions listed above.
Suggestion
In my opinion, under those conditions the backup should be made.
The text was updated successfully, but these errors were encountered: