(self, action: str, *args, **kwargs)
| 496 | self.run_counts = {} |
| 497 | |
| 498 | def __call__(self, action: str, *args, **kwargs) -> Any: |
| 499 | method = getattr(self, action, None) |
| 500 | if method is None or action.startswith('_'): |
| 501 | raise ValueError(f"Unknown action: {action}") |
| 502 | |
| 503 | # Track runs |
| 504 | self.last_runs[action] = datetime.now().isoformat() |
| 505 | self.run_counts[action] = self.run_counts.get(action, 0) + 1 |
| 506 | |
| 507 | return method(*args, **kwargs) |
| 508 | |
| 509 | def cleanup_old_files(self, directory: str, max_age_days: int = 7) -> dict: |
| 510 | """ |