Skip to content

Commit 7c0cc1b

Browse files
feat(winrate): add ConfirmationStore.clear to remove pending keys
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 183d9a5 commit 7c0cc1b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/utils/winrate_upgrade.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,21 @@ def expire_all_older_than(self, ttl: int) -> int:
126126
pass
127127
return removed
128128

129+
def clear(self, key: str) -> bool:
130+
"""Remove a pending confirmation key if present. Returns True if removed."""
131+
with self.lock:
132+
if key in self._data:
133+
try:
134+
del self._data[key]
135+
try:
136+
self._save()
137+
except Exception:
138+
pass
139+
return True
140+
except Exception:
141+
return False
142+
return False
143+
129144

130145
def check_market_quality_for_entry(best_bid: Optional[float], best_ask: Optional[float], ask_size: Optional[float], settings) -> Tuple[bool, str, Dict[str, Any]]:
131146
"""

0 commit comments

Comments
 (0)