Skip to content

Commit 28d1436

Browse files
committed
* fixes time zone related issue in Cache$prune().
* fixes bug in `rotate_rds(on_change_only = TRUE)` that occurs if a version of data.table < 1.3.0 is installed and either the source or target object are a `data.table` (but not both) * more robust clean up of temporary files in most unit tests
1 parent 749d209 commit 28d1436

File tree

10 files changed

+245
-87
lines changed

10 files changed

+245
-87
lines changed

CRAN-RELEASE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This package was submitted to CRAN on 2020-10-18.
2+
Once it is accepted, delete this file and tag the release (commit 18db480cc6).

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: rotor
33
Title: Log Rotation and Conditional Backups
4-
Version: 0.3.0
4+
Version: 0.3.1
55
Authors@R:
66
person(given = "Stefan",
77
family = "Fleck",

NEWS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# rotor 0.3.1
2+
3+
* fixes time zone related issue in `Cache$prune()`.
4+
* fixes bug in `rotate_rds(on_change_only = TRUE)` that occurs if a version
5+
of data.table < 1.3.0 is installed and either the source or target object are a
6+
`data.table` (but not both)
7+
* more robust clean up of temporary files in most unit tests
8+
9+
110
# rotor 0.3.0
211

312
* Improved some error messages

R/BackupQueue.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ select_prune_files_by_age <- function(
935935
limit <- dint::first_of_isoweek(dint::as_date_yw(now) - max_age$value + 1L)
936936

937937
} else if (identical(max_age[["unit"]], "day")){
938-
limit <- as.Date(now) - max_age$value + 1L
938+
limit <- as.Date(as.character(now)) - max_age$value + 1L
939939
}
940940

941941
to_remove <- path[as.Date(as.character(timestamp)) < limit]

R/Cache.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Cache <- R6::R6Class(
134134
assert(is.null(max_files) || is.infinite(max_files) || is_n0(max_files))
135135
files <- self$files
136136
files <- files[order(files$mtime), ]
137-
now <- as.Date(now)
137+
now <- as.Date(as.character(now))
138138

139139
rem <- list()
140140

R/rotate_rds.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ rotate_rds_internal <- function(
137137
if (file.exists(file)){
138138
if (on_change_only){
139139
comp <- readRDS(file)
140+
140141
if (
141142
identical(object, comp) ||
142-
(inherits(object, "data.table") && assert_namespace("data.table") && isTRUE(all.equal(object, comp)))
143+
(inherits(object, "data.table") && inherits(comp, "data.table") && assert_namespace("data.table") && isTRUE(all.equal(object, comp)))
143144
){
144145
message(ObjectHasNotChangedMessage("not rotating: object has not changed"))
145146
return(invisible(file))

cran-comments.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11
## Test environments
2+
* ubuntu 20.04, R 4.0.2
23
* ubuntu 18.04 (via RStudio Server), R 4.0.2
34
* ubuntu 16.04 (via travis), R 3.6.1
4-
* win-builder (devel)
5+
* win-builder, R devel
6+
* macOS 10.13.6 High Sierra, R-release, brew (via Rhub)
57
* rhub::check_for_cran()
68

79
## R CMD check results
810

911
0 errors | 0 warnings | 0 notes
1012

11-
added new functionality (see NEWS.md)
13+
* fixes time zone related issue in `Cache$prune()` that causes macOS tests to fail
14+
* more robust cleanup of temporary files between some tests
15+
* resubmission that improves one test where
16+
`https://cran.r-project.org/web/checks/check_results_rotor.html` shows an
17+
error that I could not reproduce on any machine available on rhub.
18+
Hopefully the test succeedes now, but if not it will give me more useful
19+
debug information for another resubmission.
20+
21+
22+
Notes:
23+
24+
There was a timezone related issue that only occured on macos. I fixed it and
25+
was able to test it on macOS 10.13.6 High Sierra with R-release (but not devel)
26+
on Rhub.
27+
28+
I could not reproduce the other errors; however, it looks as if they were caused
29+
by improperly cleaned-up temporary files between failing tests. I made the
30+
cleanup code a bit more robust and hope the problem is fixed now.

0 commit comments

Comments
 (0)