Skip to content

Commit

Permalink
Fix a buggy startup error - delay before dbussy
Browse files Browse the repository at this point in the history
The app sometimes exits immediately with a segfault. This reference
suggests it is a startup race condition in dbussy:

ldo/dbussy#15 (comment)
  • Loading branch information
davesteele committed Jul 18, 2021
1 parent ffeb47f commit 6714c77
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions comitup_watch/devicemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def __init__(self, bus, event_queue):
super().__init__(bus)

async def startup(self) -> None:

await asyncio.sleep(0.1)

for devpath in await self.GetAllDevices():
# print(devpath)
await self.add_dev_path(devpath)
Expand All @@ -59,8 +62,6 @@ async def startup(self) -> None:

async def add_dev_path(self, path):

# print("Added device path", path)

if str(path) not in self.dev_paths:
self.dev_paths |= set(str(path))

Expand All @@ -82,8 +83,6 @@ async def add_dev_path(self, path):

@ravel.signal(name="DeviceAdded", in_signature="o")
async def device_added_signal(self, path):
# print(path)

# print("strpath", path)
await self.add_dev_path(path)

Expand Down

0 comments on commit 6714c77

Please sign in to comment.