Commit b542ef50 authored by Charles's avatar Charles

add logs when it fails

parent b8e2fa2d
......@@ -21,6 +21,10 @@ res <- tryCatch(write_dispo(dt),
# If writing fails, attempt again in 5 minutes
for (i in 1:300) {
if (res == FALSE) {
dt <- data.table(time = Sys.time(),
success = FALSE)
fwrite(dt, file = file.path(Sys.getenv("VELOV_CSV"), "logs.csv"),
append = TRUE)
Sys.sleep(5 * 60)
res <- tryCatch(write_dispo(dt),
error = function(e) FALSE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment