One pull at a time: the run is claimed in the database and its marker rides in each batch
A second pull (schedule, Run button, `app job pull` in another process) could start while one was fetching and overwrite the stored run marker, so the first run's boards failed their stamp check or a settle closed on the other run's id lists. `claim_run` sets `pull:run` in one conditional statement, only while it equals `pull:settled` or is older than an hour; a refused `pull` job queues no stage and says so in its result and a notice, and the CLI exits 1. Batches carry the marker in their payload, the plugins stamp with it, and the settle reads it off its own batches' payloads before releasing the run. Co-Authored-By: Claude Opus <noreply@anthropic.com>
This commit is contained in:
1 parent
c7da12b93d
commit
b43fc54565
11 files changed
+328
-70
No files matched your search
+2
-1
@@ -340,7 +340,8 @@ class SearchSource(Source):
|
||||
|
||||
def fetch(self) -> Iterator[Item]:
|
||||
with httpx.Client() as client:
|
||||
run_marker = self.state.get("search:run", "") or datetime.now(UTC).isoformat(
|
||||
# The pull run's marker, handed in by its batch as for `ats`.
|
||||
run_marker = str(self.options.get("run") or "") or datetime.now(UTC).isoformat(
|
||||
timespec="seconds")
|
||||
for target, label in self.targets():
|
||||
provider = provider_of(target)
|
||||
|
||||
Reference in new issue
Block a user