Skip to content

Commit 5ca115a

Browse files
committed
[Update] server: condition in accept loop
1 parent 9fa89d0 commit 5ca115a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/py/extra/server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ async def Serve(
304304
# TODO: Add condition
305305
try:
306306
while True:
307+
if options.condition and not options.condition():
308+
break
307309
try:
308310
client, _ = await loop.sock_accept(server)
309311
# NOTE: Should do something with the tasks

0 commit comments

Comments
 (0)