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

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 pushed 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 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

this commit solves the problem. Thank you!

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

No branches or pull requests

2 participants