feat(strategy-state): persist instance-scoped slot maps
This commit is contained in:
@@ -52,8 +52,6 @@ class SlotService:
|
||||
# does not serialize transitions across instances (NFR-1).
|
||||
self._instance_key = instance_key
|
||||
self._lock_id = slot_advisory_lock_id(instance_key)
|
||||
# dcy-028/REQ-081 (C-3): when injected, all strategy_state for a slot is
|
||||
# deleted on close (→INACTIVE). None keeps legacy behaviour (no store).
|
||||
self._strategy_state_store = strategy_state_store
|
||||
|
||||
@property
|
||||
@@ -155,11 +153,6 @@ class SlotService:
|
||||
extra=extra or {},
|
||||
)
|
||||
)
|
||||
# dcy-028/REQ-081 (C-3): close deletes the slot's strategy_state so a
|
||||
# reused slot starts empty. Covers every close path (strategy sell,
|
||||
# safety-sell, forced-close, operator) since all funnel to →INACTIVE.
|
||||
if to_state is SlotState.INACTIVE and self._strategy_state_store is not None:
|
||||
self._strategy_state_store.delete_all(slot_id)
|
||||
return updated
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user