You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking to use memoise in my R Shiny application with functions that will query our database on MongoDB Atlas using a RESTful API that requires a unique access token per session. For example:
#Calls to the RESTful API are made within the function.
getResults <- function(query, access_token){
#Code here!
}
getResultsMem <- memoise(getResults)
From what I understand, because memoise caches the function rather than the results, I'm having an issue where I can't use memoise since the access token changes every time that the user logs in. Since the database will only be updated once a year, memoise/caching is an ideal solution for my application. Is there a solution around this?
The text was updated successfully, but these errors were encountered:
One way to work around this would be to read the access token from an environment variable rather than as a parameter. There currently is not a way to exclude a parameter from being included in the memoize hash.
Thanks so much for the response Jim! Out of curiosity, I noticed a parameter labeled omit_args in the development version of the memoise function. Once the newest version of the memoise package is published, would I be able to use that argument to have the memoise function ignore a parameter in a function?
I'm looking to use memoise in my R Shiny application with functions that will query our database on MongoDB Atlas using a RESTful API that requires a unique access token per session. For example:
From what I understand, because memoise caches the function rather than the results, I'm having an issue where I can't use memoise since the access token changes every time that the user logs in. Since the database will only be updated once a year, memoise/caching is an ideal solution for my application. Is there a solution around this?
The text was updated successfully, but these errors were encountered: