Skip to content

Commit

Permalink
fix: Fixed history gc invocation failing when sqlite history … (
Browse files Browse the repository at this point in the history
xonsh#5540)

…backend is used.


## For community
⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍
comment**
  • Loading branch information
jnoortheen authored Jun 26, 2024
1 parent a52aa5f commit 0f2011d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
23 changes: 23 additions & 0 deletions news/sqlite-history-gc.rst
Original file line number Diff line number Diff line change
@@ -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>
2 changes: 1 addition & 1 deletion xonsh/history/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def info(self):
"""
raise NotImplementedError

def run_gc(self, size=None, blocking=True):
def run_gc(self, size=None, blocking=True, **_):
"""Run the garbage collector.
Parameters
Expand Down
2 changes: 1 addition & 1 deletion xonsh/history/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def info(self):
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.
Expand Down
2 changes: 1 addition & 1 deletion xonsh/history/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def pull(self, show_commands=False):
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():
Expand Down

0 comments on commit 0f2011d

Please sign in to comment.