Skip to content

Commit

Permalink
Simplify the code and avoid using runif
Browse files Browse the repository at this point in the history
  • Loading branch information
Moohan committed Jul 17, 2023
1 parent 9828b89 commit 2676516
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/write_tests_xlsx.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ write_tests_xlsx <- function(comparison_data, sheet_name, year = NULL) {
while (fs::file_exists(path = in_use_path) && seconds < max_wait) {
# While the tests are in use (wait a random number of seconds from 1 to 30)

Check warning on line 48 in R/write_tests_xlsx.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/write_tests_xlsx.R,line=48,col=81,[line_length_linter] Lines should not be more than 80 characters.
cli::cli_progress_update()
wait <- round(runif(1, 1, 15))
wait <- sample(x = 3:15, size = 1)

Sys.sleep(wait)
seconds <- seconds + wait
Expand All @@ -56,7 +56,7 @@ write_tests_xlsx <- function(comparison_data, sheet_name, year = NULL) {
}

# Final check to maybe avoid corrupting the workbook
Sys.sleep(round(runif(1, 1, 3)))
Sys.sleep(sample(x = 1:3, size = 1))
if (!fs::file_exists(path = in_use_path)) {
fs::file_create(path = in_use_path)
} else {
Expand Down

0 comments on commit 2676516

Please sign in to comment.