I have connected to the websocket server
source(paste0(path, "source.R"))
ws$connect
In the source path, there is following information
ws <- WebSocket$new("wss://XXXXX/WebSocket", autoConnect = FALSE)
ws$onError(function(event) {
cat("Client failed to connect: ", event$message, "
")
})
ws$onOpen(function(event) {
con$send("hello")
})
How can I make that if the error occurred between time 09.00 and 18.00, then do ws$close
and run again:
source(paste0(path, "source.R"))
ws$connect
As a result, it will rerun every time there is an error inside this period of time. If outside then only run ws$close
question from:
https://stackoverflow.com/questions/65846219/how-call-the-code-from-the-beginning-if-the-error-occurred 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…