mirror of
https://github.com/rclone/rclone.git
synced 2024-11-29 03:48:27 +08:00
http: fix serve http exits directly after starting
This commit is contained in:
parent
f39a08c9d7
commit
bc74f0621e
|
@ -69,6 +69,7 @@ control the stats printing.
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
s.Bind(router)
|
s.Bind(router)
|
||||||
|
httplib.Wait()
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -231,6 +231,11 @@ func (s *server) Serve() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wait blocks while the server is serving requests
|
||||||
|
func (s *server) Wait() {
|
||||||
|
s.closing.Wait()
|
||||||
|
}
|
||||||
|
|
||||||
// Router returns the server base router
|
// Router returns the server base router
|
||||||
func (s *server) Router() chi.Router {
|
func (s *server) Router() chi.Router {
|
||||||
return s.baseRouter
|
return s.baseRouter
|
||||||
|
@ -291,6 +296,11 @@ func Restart() error {
|
||||||
return start()
|
return start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wait blocks while the default http server is serving requests
|
||||||
|
func Wait() {
|
||||||
|
defaultServer.Wait()
|
||||||
|
}
|
||||||
|
|
||||||
// Start the default server
|
// Start the default server
|
||||||
func start() error {
|
func start() error {
|
||||||
defaultServerMutex.Lock()
|
defaultServerMutex.Lock()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user