Skip to content

Commit 8d18ccc

Browse files
author
Luka Žaja
committed
Added backwards compatibility for watchdog's dispatch_events() call.
1 parent 36af772 commit 8d18ccc

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = refind_btrfs
3-
version = 0.5.5
3+
version = 0.5.6
44
description = Generate rEFInd manual boot stanzas from Btrfs snapshots
55
long_description = file: README.md
66
keywords = rEFInd, btrfs

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
setuptools.setup(
3030
name="refind-btrfs",
31-
version="0.5.5",
31+
version="0.5.6",
3232
author="Luka Žaja",
3333
author_email="luka.zaja@protonmail.com",
3434
description="Generate rEFInd manual boot stanzas from Btrfs snapshots",

src/refind_btrfs/service/snapshot_observer.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
import queue
2525

26+
from inspect import signature
27+
from typing import Any
28+
2629
from injector import inject
2730

2831
from refind_btrfs.common import CheckableObserver, constants
@@ -42,7 +45,14 @@ def run(self) -> None:
4245

4346
while self.should_keep_running():
4447
try:
45-
self.dispatch_events(self.event_queue)
48+
arguments: list[Any] = [self.event_queue]
49+
dispatch_events_signature = signature(self.dispatch_events)
50+
parameters = dispatch_events_signature.parameters
51+
52+
if "timeout" in parameters:
53+
arguments.append(self.timeout)
54+
55+
self.dispatch_events(*arguments)
4656
except queue.Empty:
4757
continue
4858
except SnapshotMountedAsRootError as e:

0 commit comments

Comments
 (0)