File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,14 @@ from becoming stale:
5757
5858 import threading
5959
60- background = threading.Thread(target = pool.ping, name = ' ping-pool' )
60+
61+ def background_loop ():
62+ while True :
63+ # (Optional) Perform other background tasks here
64+ pool.ping()
65+
66+
67+ background = threading.Thread(target = background_loop, name = ' ping-pool' )
6168 background.daemon = True
6269 background.start()
6370
@@ -91,6 +98,13 @@ started before it is used:
9198
9299 import threading
93100
94- background = threading.Thread(target = pool.ping, name = ' ping-pool' )
101+
102+ def background_loop ():
103+ while True :
104+ # (Optional) Perform other background tasks here
105+ pool.ping()
106+
107+
108+ background = threading.Thread(target = background_loop, name = ' ping-pool' )
95109 background.daemon = True
96110 background.start()
You can’t perform that action at this time.
0 commit comments