Skip to content

Commit aed4969

Browse files
snopokeclaude
andcommitted
fix(procrastinate): skip built-in tasks; document known limitations
- ProcrastinateSystemIntegration.track_task now refuses task names starting with "builtin:" or "procrastinate." so Procrastinate's own housekeeping jobs aren't auto-tracked. - README documents three known limitations: configure().defer(), batch_defer*, and post-init add_tasks_from. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3ebacc2 commit aed4969

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,9 @@ taskbadger.init(
9292
)],
9393
)
9494
```
95+
96+
#### Known limitations
97+
98+
- **`task.configure(...).defer(...)` is not tracked.** Procrastinate's `configure()` returns a separate `JobDeferrer` whose methods bypass our wrapper. Use `task.defer(...)` directly for tracked deferrals. Tasks deferred via `configure().defer()` will run normally but will not appear in TaskBadger.
99+
- **`task.batch_defer*` is not tracked.** Same reason as `configure().defer()`.
100+
- **Tasks added via `app.add_tasks_from(blueprint)` after `ProcrastinateSystemIntegration` is constructed are not auto-instrumented.** Construct the integration after all blueprints are registered, or apply `@track` to those tasks explicitly.

taskbadger/systems/procrastinate.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ def track_task(self, task_name):
4646
if not self.auto_track_tasks:
4747
return False
4848

49+
# Never auto-track Procrastinate's built-in housekeeping tasks
50+
# (e.g. ``builtin:procrastinate.builtin_tasks.remove_old_jobs``).
51+
if task_name.startswith("builtin:") or task_name.startswith("procrastinate."):
52+
return False
53+
4954
if self.excludes:
5055
for exclude in self.excludes:
5156
if re.fullmatch(exclude, task_name):

0 commit comments

Comments
 (0)