taskops-cli 0.5.7__py3-none-any.whl → 0.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- taskops/_version.py +1 -1
- taskops/store/cache.py +13 -2
- taskops/ui/app.js +19 -19
- taskops/verbs/events.py +39 -10
- {taskops_cli-0.5.7.dist-info → taskops_cli-0.6.0.dist-info}/METADATA +1 -1
- {taskops_cli-0.5.7.dist-info → taskops_cli-0.6.0.dist-info}/RECORD +8 -8
- {taskops_cli-0.5.7.dist-info → taskops_cli-0.6.0.dist-info}/WHEEL +0 -0
- {taskops_cli-0.5.7.dist-info → taskops_cli-0.6.0.dist-info}/entry_points.txt +0 -0
taskops/_version.py
CHANGED
taskops/store/cache.py
CHANGED
|
@@ -93,8 +93,19 @@ class Cache:
|
|
|
93
93
|
rows = self._query("SELECT kind, COUNT(*) FROM events GROUP BY kind")
|
|
94
94
|
return {str(kind): int(n) for kind, n in rows}
|
|
95
95
|
|
|
96
|
-
def since(self, seq: int) -> list[tuple[int, Event]]:
|
|
97
|
-
|
|
96
|
+
def since(self, seq: int, limit: int | None = None) -> list[tuple[int, Event]]:
|
|
97
|
+
"""Everything after `seq`, OLDEST first — replay's order, and the order
|
|
98
|
+
a live reader catches up in.
|
|
99
|
+
|
|
100
|
+
`limit` is for the second caller only (`verbs/events.py`'s `after=`): a
|
|
101
|
+
page of a CATCH-UP is read forwards, so the cap has to fall on the
|
|
102
|
+
oldest end and not on the newest, which is the one thing a descending
|
|
103
|
+
`page()` cannot do. Replay passes nothing and reads the tail whole —
|
|
104
|
+
that is what makes a cache rebuildable.
|
|
105
|
+
"""
|
|
106
|
+
if limit is None:
|
|
107
|
+
return self._events("WHERE seq > ? ORDER BY seq", (seq,))
|
|
108
|
+
return self._events("WHERE seq > ? ORDER BY seq LIMIT ?", (seq, limit))
|
|
98
109
|
|
|
99
110
|
def page(self, before: int | None, limit: int) -> list[tuple[int, Event]]:
|
|
100
111
|
"""One page of the whole log, NEWEST FIRST, by keyset on `seq`.
|