diff --git a/R/class_reporter.R b/R/class_reporter.R index 33e19cb4..dc6d0f20 100644 --- a/R/class_reporter.R +++ b/R/class_reporter.R @@ -28,16 +28,16 @@ reporter_class <- R6::R6Class( public = list( seconds_interval = NULL, buffer = NULL, - seconds_flushed = NULL, + seconds_flushed = -Inf, + seconds_skipped = -Inf, initialize = function(seconds_interval = NULL) { self$seconds_interval <- seconds_interval }, poll = function() { - self$seconds_flushed <- self$seconds_flushed %|||% -Inf now <- time_seconds_local() - if ((now - self$seconds_flushed) > self$seconds_interval) { - self$flush_messages() - self$seconds_flushed <- time_seconds_local() + if ((now - seconds_flushed) > seconds_interval) { + flush_messages() + self$seconds_flushed <- now } }, report_start = function() { @@ -75,3 +75,5 @@ reporter_class <- R6::R6Class( } ) ) + +reporter_seconds_skipped <- 0.25 diff --git a/R/class_summary.R b/R/class_summary.R index 80f19aa6..fc18df81 100644 --- a/R/class_summary.R +++ b/R/class_summary.R @@ -31,7 +31,11 @@ summary_class <- R6::R6Class( self$report_progress(progress) }, report_skipped = function(target = NULL, progress) { - self$report_progress(progress) + now <- time_seconds_local() + if ((now - seconds_skipped) > reporter_seconds_skipped) { + report_progress(progress) + self$seconds_skipped <- now + } }, report_errored = function(target = NULL, progress) { self$report_progress(progress)