Skip to content

Commit ffeab85

Browse files
committed
Further improve finishing process
1 parent d2c6c63 commit ffeab85

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: checked
22
Title: Systematically Run R CMD Checks
3-
Version: 0.5.1.9002
3+
Version: 0.5.1.9003
44
Authors@R:
55
c(
66
person(

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Finish check process even if checks seem incomplete but 3 or mire minutes have
1111
passed since the process ended to avoid infinite loops.
1212

13+
* Further improvements to the check process finisher.
14+
1315
# checked 0.5.1
1416

1517
* Export STATUS vector to make external statuses analysis easier.

R/check_process.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,18 @@ check_process <- R6::R6Class(
7171
if (!self$is_alive()) callback(self)
7272
},
7373
finish = function() {
74-
# self$checks active binding calls poll_output so there is not need
75-
# to call it explicitly
74+
# Make sure results are polled
75+
self$poll_output()
7676
checks <- self$checks
7777
# In some cases, check subprocess might suffer from a race condition, when
7878
# process itself finished, but the final results of the last subcheck
7979
# are not yet available to parse. Therefore we allow the process to
8080
# finalize only if the last subcheck has reported status. However
8181
# if we stuck in this state for longer than 3 minutes we should
8282
# try to finish anyway, to prevent possible infinite loops.
83+
time_finished <- self$get_time_finish() %||% Sys.time()
8384
if (checks[length(checks)] != "" ||
84-
(Sys.time() - self$get_time_finish() >= as.difftime(3, units = "mins"))) {
85+
((Sys.time() - time_finished) >= as.difftime(3, units = "mins"))) {
8586
self$save_results()
8687
private$cache_parsed_results()
8788
private$free_file_descriptors()

0 commit comments

Comments
 (0)