mirror of
https://github.com/hansjone/netx.git
synced 2026-10-18 13:50:45 +08:00
Scale biz_state collects with dedicated workers and non-blocking UI poll.
Add PG claim/NE mutex, persist pool, and biz_state_worker replicas; fix double-SSH and row-count bugs; stop 32m collectNow while-loop from freezing page switches. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
0eb65a839e
commit
3a0de0d7fb
22 changed files with 1210 additions and 165 deletions
|
|
@ -88,6 +88,21 @@ class BizStateCollectRecoveryTests(unittest.TestCase):
|
|||
assert ok is not None
|
||||
self.assertEqual(ok.status, "success")
|
||||
|
||||
def test_queued_batch_also_marked_partial(self) -> None:
|
||||
q = BizStateBatch(
|
||||
id="b_q",
|
||||
task_id="t1",
|
||||
status="queued",
|
||||
message="queued",
|
||||
)
|
||||
self.db.add(q)
|
||||
self.db.commit()
|
||||
out = recover_interrupted_collects_on_startup(self.db)
|
||||
self.assertGreaterEqual(out["batches"], 2)
|
||||
self.db.refresh(q)
|
||||
self.assertEqual(q.status, "partial")
|
||||
self.assertIn("interrupted_by_restart", q.message or "")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue