Return the result from the cache backend
(task_id, wait=0, broker=None)
| 152 | |
| 153 | |
| 154 | def result_cached(task_id, wait=0, broker=None): |
| 155 | """ |
| 156 | Return the result from the cache backend |
| 157 | """ |
| 158 | if not broker: |
| 159 | broker = get_broker() |
| 160 | start = time() |
| 161 | while True: |
| 162 | r = broker.cache.get(f"{broker.list_key}:{task_id}") |
| 163 | if r: |
| 164 | return SignedPackage.loads(r)["result"] |
| 165 | if (time() - start) * 1000 >= wait >= 0: |
| 166 | break |
| 167 | sleep(0.01) |
| 168 | |
| 169 | |
| 170 | def result_group(group_id, failures=False, wait=0, count=None, cached=Conf.CACHED): |
no test coverage detected