remove zero downtime for windows.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -2,7 +2,6 @@ package gorush
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/appleboy/endless"
|
||||
"github.com/gin-gonic/gin"
|
||||
api "gopkg.in/appleboy/gin-status-api.v1"
|
||||
"net/http"
|
||||
@@ -81,15 +80,3 @@ func routerEngine() *gin.Engine {
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
// RunHTTPServer provide run http or https protocol.
|
||||
func RunHTTPServer() error {
|
||||
var err error
|
||||
if PushConf.Core.SSL && PushConf.Core.CertPath != "" && PushConf.Core.KeyPath != "" {
|
||||
err = endless.ListenAndServeTLS(":"+PushConf.Core.Port, PushConf.Core.CertPath, PushConf.Core.KeyPath, routerEngine())
|
||||
} else {
|
||||
err = endless.ListenAndServe(":"+PushConf.Core.Port, routerEngine())
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
20
gorush/server_unix.go
Normal file
20
gorush/server_unix.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
|
||||
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"github.com/fvbock/endless"
|
||||
)
|
||||
|
||||
// RunHTTPServer provide run http or https protocol.
|
||||
func RunHTTPServer() error {
|
||||
var err error
|
||||
|
||||
if PushConf.Core.SSL && PushConf.Core.CertPath != "" && PushConf.Core.KeyPath != "" {
|
||||
err = endless.ListenAndServeTLS(":"+PushConf.Core.Port, PushConf.Core.CertPath, PushConf.Core.KeyPath, routerEngine())
|
||||
} else {
|
||||
err = endless.ListenAndServe(":"+PushConf.Core.Port, routerEngine())
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
18
gorush/server_windows.go
Normal file
18
gorush/server_windows.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package gorush
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// RunHTTPServer provide run http or https protocol.
|
||||
func RunHTTPServer() error {
|
||||
var err error
|
||||
|
||||
if PushConf.Core.SSL && PushConf.Core.CertPath != "" && PushConf.Core.KeyPath != "" {
|
||||
err = http.ListenAndServeTLS(":"+PushConf.Core.Port, PushConf.Core.CertPath, PushConf.Core.KeyPath, routerEngine())
|
||||
} else {
|
||||
err = http.ListenAndServe(":"+PushConf.Core.Port, routerEngine())
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user