-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for hot reloading interval handling and refreshing apps within viewer pane #148
Conversation
R/dash.R
Outdated
else { | ||
# determine if the time since last reload end is equal to or longer than the requested check interval | ||
# (Sys.time() - private$last_reload) provides time in seconds, same units as hot_reload_watch_interval | ||
permit_reload <- (Sys.time() - private$last_reload) >= hot_reload_watch_interval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will work. But a common way to do it with only one variable is to start with private$last_reload = 0
or some known distant past time (0 often works for that purpose because it typically means the unix epoch = 1/1/1970)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 0ce7a6d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃 looks good, just one comment to consider if you want to tighten up the logic a bit.
* Provide support for no_update in Dash for R (#111) * Use dev_tools_prune_errors instead of pruned_errors (#113) * Better handling for user-defined error conditions in debug mode (#116) * Provide support for multiple outputs (#119) * Provide support for hot reloading in Dash for R (#127) * Implement support for clientside callbacks in Dash for R (#130) * Add line number context to stack traces when srcrefs are available (#133) * Update dash-renderer to 1.2.2 and fix dev tools UI display of stack traces (#137) * Support for meta tags in Dash for R (#142) * Fixes for hot reloading interval handling and refreshing apps within viewer pane (#148) * Support for asynchronous loading/compression in Dash for R (#157) * Support returning asset URLs via public method within Dash class (#160) * Minor fix for get_asset_url + docs, add url_base_pathname (#161)
This PR proposes several modifications to address issues noted in #146 and #147:
private$in_viewer
field tracks whether the app should be reloaded within RStudio's viewer paneapp_url
now usesself$server$host
andself$server$port
self$config$hot_reload
incorrectly usedhot_reload_watch_interval
, this has been corrected tohot_reload_interval
permit_reload
is alwaysTRUE
until one reload event has occurred; on subsequent cycles, reloads are permitted if the current (wall) time is at leasthot_reload_watch_interval
seconds greater than the time stored inprivate$last_reload
Resolves #146, fixes #147.