mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
fix: Fixed `history gc
invocation failing when
sqlite
` history … (#5540)
…backend is used. ## For community ⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍 comment**
This commit is contained in:
parent
a52aa5febc
commit
0f2011d302
4 changed files with 26 additions and 3 deletions
23
news/sqlite-history-gc.rst
Normal file
23
news/sqlite-history-gc.rst
Normal file
|
@ -0,0 +1,23 @@
|
|||
**Added:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Changed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Deprecated:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Removed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* Fixed ``history gc`` invocation failing when ``sqlite`` history backend is used.
|
||||
|
||||
**Security:**
|
||||
|
||||
* <news item>
|
|
@ -156,7 +156,7 @@ class History:
|
|||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def run_gc(self, size=None, blocking=True):
|
||||
def run_gc(self, size=None, blocking=True, **_):
|
||||
"""Run the garbage collector.
|
||||
|
||||
Parameters
|
||||
|
|
|
@ -585,7 +585,7 @@ class JsonHistory(History):
|
|||
data["gc_last_size"] = f"{(self.hist_size, self.hist_units)}"
|
||||
return data
|
||||
|
||||
def run_gc(self, size=None, blocking=True, force=False):
|
||||
def run_gc(self, size=None, blocking=True, force=False, **_):
|
||||
self.gc = JsonHistoryGC(wait_for_shell=False, size=size, force=force)
|
||||
if blocking:
|
||||
while self.gc.is_alive(): # while waiting for gc.
|
||||
|
|
|
@ -382,7 +382,7 @@ class SqliteHistory(History):
|
|||
self.last_pull_time = time.time()
|
||||
return cnt
|
||||
|
||||
def run_gc(self, size=None, blocking=True):
|
||||
def run_gc(self, size=None, blocking=True, **_):
|
||||
self.gc = SqliteHistoryGC(wait_for_shell=False, size=size)
|
||||
if blocking:
|
||||
while self.gc.is_alive():
|
||||
|
|
Loading…
Add table
Reference in a new issue