(task_id: str, update_ttl: bool = False)
| 319 | |
| 320 | |
| 321 | def get_cached_task(task_id: str, update_ttl: bool = False): |
| 322 | # By calling keep before tryGet, wont discard if was expired. |
| 323 | if update_ttl and not task_cache.keep(task_id, TASK_TTL): |
| 324 | # Failed to keep task, already gone. |
| 325 | return None |
| 326 | return task_cache.tryGet(task_id) |
| 327 | |
| 328 | |
| 329 | def get_cached_session(session_id: str, update_ttl: bool = False): |