Count the results in a group in the cache backend
(group_id, failures=False, broker=None)
| 369 | |
| 370 | |
| 371 | def count_group_cached(group_id, failures=False, broker=None): |
| 372 | """ |
| 373 | Count the results in a group in the cache backend |
| 374 | """ |
| 375 | if not broker: |
| 376 | broker = get_broker() |
| 377 | group_list = broker.cache.get(f"{broker.list_key}:{group_id}:keys") |
| 378 | if group_list: |
| 379 | if not failures: |
| 380 | return len(group_list) |
| 381 | failure_count = 0 |
| 382 | for task_key in group_list: |
| 383 | task = SignedPackage.loads(broker.cache.get(task_key)) |
| 384 | if not task["success"]: |
| 385 | failure_count += 1 |
| 386 | return failure_count |
| 387 | |
| 388 | |
| 389 | def delete_group(group_id, tasks=False, cached=Conf.CACHED): |
no test coverage detected