Skip to content

Commit f7811ee

Browse files
committed
app: Fix semaphore in a different event loop bug
1 parent 9214043 commit f7811ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ndn/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def __init__(self, face=None, keychain=None):
6666
self.data_validator = sha256_digest_checker
6767
self.int_validator = sha256_digest_checker
6868
self._autoreg_routes = []
69-
self._prefix_register_semaphore = aio.Semaphore(1)
7069

7170
async def _receive(self, typ: int, data: BinaryStr):
7271
"""
@@ -248,6 +247,8 @@ async def main_loop(self, after_start: Awaitable = None) -> bool:
248247
:return: ``True`` if the connection is shutdown not by ``Ctrl+C``.
249248
For example, manually or by the other side.
250249
"""
250+
self._prefix_register_semaphore = aio.Semaphore(1)
251+
251252
async def starting_task():
252253
for name, route, validator, need_raw_packet, need_sig_ptrs in self._autoreg_routes:
253254
await self.register(name, route, validator, need_raw_packet, need_sig_ptrs)

0 commit comments

Comments
 (0)