mirror of https://github.com/vapor/docs.git
if -> while
This commit is contained in:
parent
cb3bad338a
commit
198d689fc8
|
|
@ -18,7 +18,7 @@ drop.socket("ws") { req, ws in
|
|||
|
||||
// ping the socket to keep it open
|
||||
try background {
|
||||
if ws.state == .open {
|
||||
while ws.state == .open {
|
||||
try? ws.ping()
|
||||
drop.console.wait(seconds: 10) // every 10 seconds
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue