lnrater: use network.asyncio_loop instead of asyncio.get_event_loop()
fixes #5376
This commit is contained in:
@@ -91,14 +91,14 @@ class LNRater(Logger):
|
|||||||
self._last_progress_percent = 0
|
self._last_progress_percent = 0
|
||||||
|
|
||||||
def maybe_analyze_graph(self):
|
def maybe_analyze_graph(self):
|
||||||
loop = asyncio.get_event_loop()
|
loop = self.network.asyncio_loop
|
||||||
fut = asyncio.run_coroutine_threadsafe(self._maybe_analyze_graph(), loop)
|
fut = asyncio.run_coroutine_threadsafe(self._maybe_analyze_graph(), loop)
|
||||||
fut.result()
|
fut.result()
|
||||||
|
|
||||||
def analyze_graph(self):
|
def analyze_graph(self):
|
||||||
"""Forces a graph analysis, e.g., due to external triggers like
|
"""Forces a graph analysis, e.g., due to external triggers like
|
||||||
the graph info reaching 50%."""
|
the graph info reaching 50%."""
|
||||||
loop = asyncio.get_event_loop()
|
loop = self.network.asyncio_loop
|
||||||
fut = asyncio.run_coroutine_threadsafe(self._analyze_graph(), loop)
|
fut = asyncio.run_coroutine_threadsafe(self._analyze_graph(), loop)
|
||||||
fut.result()
|
fut.result()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user