Skip to content

Commit 8900fea

Browse files
committed
Clarify per-key reservation flow in populate()
Each job is marked as 'reserved' individually before its make() call, matching the current implementation's behavior.
1 parent 6b986ae commit 8900fea

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/src/design/autopopulate-2.0-spec.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,12 @@ def populate(
310310
311311
New behavior with reserve_jobs=True:
312312
1. If refresh=True, calls self.jobs.refresh(*restrictions)
313-
2. Fetches jobs from self.jobs where status='pending' and scheduled_time <= now
314-
3. Reserves and processes jobs using the jobs table
315-
4. Records success/error status in jobs table
313+
2. For each pending job (ordered by priority, scheduled_time):
314+
a. Mark job as 'reserved' (per-key, before make)
315+
b. Call make(key)
316+
c. On success: mark job as 'success'
317+
d. On error: mark job as 'error' with message/stack
318+
3. Continue until no more pending jobs or max_calls reached
316319
"""
317320
...
318321
```

0 commit comments

Comments
 (0)