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:
Noorhteen Raja NJ 2024-06-26 13:19:26 +05:30 committed by GitHub
parent a52aa5febc
commit 0f2011d302
Failed to generate hash of commit
4 changed files with 26 additions and 3 deletions

View 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>

View file

@ -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

View file

@ -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.

View file

@ -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():