Move job register into servapi
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
d5e41c1cb6
commit
e743021193
|
@ -52,7 +52,6 @@ type HttpApiFunc func(eng *engine.Engine, version float64, w http.ResponseWriter
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
engine.Register("serveapi", ServeApi)
|
engine.Register("serveapi", ServeApi)
|
||||||
engine.Register("acceptconnections", AcceptConnections)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func hijackServer(w http.ResponseWriter) (io.ReadCloser, io.Writer, error) {
|
func hijackServer(w http.ResponseWriter) (io.ReadCloser, io.Writer, error) {
|
||||||
|
@ -1211,6 +1210,10 @@ func ServeApi(job *engine.Job) engine.Status {
|
||||||
)
|
)
|
||||||
activationLock = make(chan struct{})
|
activationLock = make(chan struct{})
|
||||||
|
|
||||||
|
if err := job.Eng.Register("acceptconnections", AcceptConnections); err != nil {
|
||||||
|
return job.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
for _, protoAddr := range protoAddrs {
|
for _, protoAddr := range protoAddrs {
|
||||||
protoAddrParts := strings.SplitN(protoAddr, "://", 2)
|
protoAddrParts := strings.SplitN(protoAddr, "://", 2)
|
||||||
go func() {
|
go func() {
|
||||||
|
|
Loading…
Reference in New Issue