-
Notifications
You must be signed in to change notification settings - Fork 57
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
memoise and jobs #95
Comments
I assume you are talking about RStudio background jobs here, but you didn't specify what a job was. If you put I think these issues are largely tangential to the memoise package and just fall out from the way R environment inheritance works. |
Same idea and issue, I wanted to cache the data as a background job with future package when starting a Shiny app, but it does not work for the second run, as a different cache file was generated.
|
I am using memoise to perform long and painful scraping, so I put the task into the job. Here's content of my job:
If I run the job, two cache files are produced, (as expected). If I rerun the same job, no new caches are created (as expected).
Now, I remembered that I have one more address to scrape, I come into my job script and modify it
Three new files are created! Wait a second!
memoise
disregarded the previously created cache because the environment has changed.I realize I've done something wrong, I come in and restore things as they were hoping
memoise
would pick old cache objectsAlas,
memoise
creates yet another two objects, disregarding everything that happened above. Now I have at least three duplicate calls to the same function with same arguments.Funny part is that my local environment, of course, is completely unaware of any of that and there's no way to get to those cached versions.
Not only that, but there's also no way to "forget" or "clean" those caches, now, as far as I understand, since the "Jobs" environment is impossible to reproduce.
Questions:
memoise
with the environment signature, given that we have an assumption that the function is "pure"? ref Clarify that memoise should only apply to pure function? #57{memoisetools}
by @coolbutuseless?The text was updated successfully, but these errors were encountered: