Queries and returns the number of past task executions.
(self)
| 588 | return getattr(func, "_task_queue", tiger.config["DEFAULT_QUEUE"]) |
| 589 | |
| 590 | def n_executions(self) -> int: |
| 591 | """ |
| 592 | Queries and returns the number of past task executions. |
| 593 | """ |
| 594 | pipeline = self.tiger.connection.pipeline() |
| 595 | pipeline.exists(self.tiger._key("task", self.id)) |
| 596 | pipeline.get(self.tiger._key("task", self.id, "executions_count")) |
| 597 | |
| 598 | exists, executions_count = pipeline.execute() |
| 599 | if not exists: |
| 600 | raise TaskNotFound("Task {} not found.".format(self.id)) |
| 601 | |
| 602 | return int(executions_count or 0) |
| 603 | |
| 604 | def retry(self) -> None: |
| 605 | """ |