-
Notifications
You must be signed in to change notification settings - Fork 606
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
Allow dynamic cache
directives using closures
#5044
base: master
Are you sure you want to change the base?
Allow dynamic cache
directives using closures
#5044
Conversation
✅ Deploy Preview for nextflow-docs-staging canceled.
|
@bentsherman I spent some time looking into this issue. There's a good chance I'm missing something, but as far as I can tell, the Further, isn't the hash mode slightly different than whether or not to cache? The mode itself can be nextflow/modules/nf-commons/src/main/nextflow/util/CacheHelper.java Lines 45 to 50 in 4c54db6
Assuming there is some step where a script's process directives are merged with the directives from a config's |
21608b4
to
530f3b2
Compare
cache = { task.tag != 'mytag' } | ||
} | ||
} | ||
''' |
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 currently doesn't work because task
is null
when this closure gets evaluated. If you define a closure like this in a nextflow.config
file, will it ever work? Isn't it attempting to capture a local variable that never exists in the context of the config file? In other words, task
s come from scripts, not config files. If closures work the way I understand them to, referencing the task
variable in nextflow.config
won't work because tasks don't get defined until the processor executes a script.
I think you just need to move the HashMode getHashMode() {
HashMode.of(get('cache')) ?: HashMode.DEFAULT()
} The |
@bentsherman thanks for the point in the right direction. |
Closes #5022