mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vweb,net: just log errors in accept() instead of panic-ing, add time.sleep(1ms) after each retry in select (#10489)
This commit is contained in:
@@ -333,7 +333,11 @@ pub fn run<T>(global_app &T, port int) {
|
||||
// request_app.Context = Context{
|
||||
// conn: 0
|
||||
//}
|
||||
mut conn := l.accept() or { panic('accept() failed') }
|
||||
mut conn := l.accept() or {
|
||||
// failures should not panic
|
||||
eprintln('accept() failed with error: $err.msg')
|
||||
continue
|
||||
}
|
||||
go handle_conn<T>(mut conn, mut request_app)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user