Skip to content

Commit b3a284e

Browse files
committed
svs: Bug fix
1 parent 58e8689 commit b3a284e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ndn/app_support/svs/sync.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class SvsInst:
5757
running: bool
5858
ndn_app: app.NDNApp | None
5959

60-
next_sync_timing: float
60+
next_sync_timing: float = 0.0
6161
timer_rst_event: aio.Event | None
6262
int_signer: enc.Signer
6363
int_validator: app.Validator
@@ -161,7 +161,7 @@ async def on_timer(self):
161161
while self.running:
162162
try:
163163
# Timer reset event
164-
await aio.wait_for(self.timer_rst_event.wait(), timeout=self.next_sync_timing - time.time())
164+
await aio.wait_for(self.timer_rst_event.wait(), timeout=max(self.next_sync_timing - time.time(), 0))
165165
self.timer_rst_event.clear()
166166
except aio.CancelledError:
167167
break

0 commit comments

Comments
 (0)