How to find out if task is cacheable or not programmatically?


(Devi Sridharan) #1

Hi,

Is it possible to find out if task is cacheable or not programmatically? For example, given a task X i want to determine if its cacheable or not.

Thanks!!


(Stefan Wolf) #2

Hi,

Currently, there is no public API to do so. Note that there are other influences to task cacheability apart from being annotated with @CacheableTask. Caching for a task can also be enabled/disabled by calling task.outputs.cacheIf or task.outputs.doNotCacheIf.

Could you describe your use case? Why are you interested if a task is cacheable or not?

Cheers,
Stefan