MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / _save

Method _save

uncommon_route/spend_control.py:267–274  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

265 self._history = [r for r in self._history if r.timestamp >= cutoff]
266
267 def _save(self) -> None:
268 self._storage.save({
269 "limits": {k: v for k, v in vars(self._limits).items() if v is not None},
270 "history": [
271 {"timestamp": r.timestamp, "amount": r.amount, "model": r.model, "action": r.action}
272 for r in self._history
273 ],
274 })
275
276 def _load(self) -> None:
277 data = self._storage.load()

Callers 3

set_limitMethod · 0.95
clear_limitMethod · 0.95
recordMethod · 0.95

Calls 1

saveMethod · 0.45

Tested by

no test coverage detected