Skip to content
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

cache() doesn't work #327

Closed
gsenseless opened this issue Mar 7, 2018 · 2 comments
Closed

cache() doesn't work #327

gsenseless opened this issue Mar 7, 2018 · 2 comments

Comments

@gsenseless
Copy link

@gsenseless gsenseless commented Mar 7, 2018

slightly modified example:

testFun <- function(x) {Sys.sleep(3); cat(x);x}

# testFun will be executed and saved to cacheRepo
tmp <- cache(cacheRepo, testFun, "Say hallo!")

# testFun execution will be loaded from repository
tmp <- cache(cacheRepo, testFun, "Say hallo!")

I'm expecting that a second call will be completed instantly, but in fact it takes 3 seconds.

Seems that problem is in saveToRepo(). It doesn't save following tag:
paste0("cacheId:", outputHash)
anymore

gsenseless added a commit to gsenseless/misc that referenced this issue Mar 7, 2018
…Added package requirements and a bit more clear...
pbiecek added a commit that referenced this issue Mar 8, 2018
@pbiecek
Copy link
Owner

@pbiecek pbiecek commented Mar 8, 2018

Try the latest commit (v2.3.1)
Looks like is it somehow related to bytecompiler, Ive removed attributes from the function and looks like it is working now.

@gsenseless
Copy link
Author

@gsenseless gsenseless commented Mar 8, 2018

this commit solves the problem. Thank you!

@pbiecek pbiecek closed this Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.