Этот коммит содержится в:
=Corey Hulen
2015-11-23 15:51:43 -08:00
родитель 5242610bf8
Коммит f8a3c9a14e
3 изменённых файлов: 6 добавлений и 8 удалений

Просмотреть файл

@@ -9,15 +9,14 @@ import (
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/mattermost/platform/store" "github.com/mattermost/platform/store"
"github.com/mattermost/platform/utils" "github.com/mattermost/platform/utils"
"github.com/throttled/throttled" "gopkg.in/throttled/throttled.v1"
throttledStore "github.com/throttled/throttled/store" throttledStore "gopkg.in/throttled/throttled.v1/store"
"net/http" "net/http"
"strings" "strings"
"time" "time"
) )
type Server struct { type Server struct {
Server *manners.GracefulServer
Store store.Store Store store.Store
Router *mux.Router Router *mux.Router
} }
@@ -29,7 +28,6 @@ func NewServer() {
l4g.Info("Server is initializing...") l4g.Info("Server is initializing...")
Srv = &Server{} Srv = &Server{}
Srv.Server = manners.NewServer()
Srv.Store = store.NewSqlStore() Srv.Store = store.NewSqlStore()
Srv.Router = mux.NewRouter() Srv.Router = mux.NewRouter()
@@ -71,7 +69,7 @@ func StartServer() {
} }
go func() { go func() {
err := Srv.Server.ListenAndServe(utils.Cfg.ServiceSettings.ListenAddress, handler) err := manners.ListenAndServe(utils.Cfg.ServiceSettings.ListenAddress, handler)
if err != nil { if err != nil {
l4g.Critical("Error starting server, err:%v", err) l4g.Critical("Error starting server, err:%v", err)
time.Sleep(time.Second) time.Sleep(time.Second)
@@ -84,7 +82,7 @@ func StopServer() {
l4g.Info("Stopping Server...") l4g.Info("Stopping Server...")
Srv.Server.Shutdown <- true manners.Close()
Srv.Store.Close() Srv.Store.Close()
hub.Stop() hub.Stop()

Просмотреть файл

@@ -4,9 +4,9 @@
package model package model
import ( import (
"code.google.com/p/go.crypto/bcrypt"
"encoding/json" "encoding/json"
"fmt" "fmt"
"golang.org/x/crypto/bcrypt"
"io" "io"
"regexp" "regexp"
"strings" "strings"

Просмотреть файл

@@ -5,10 +5,10 @@ package model
import ( import (
"bytes" "bytes"
"code.google.com/p/go-uuid/uuid"
"encoding/base32" "encoding/base32"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/pborman/uuid"
"io" "io"
"net/mail" "net/mail"
"net/url" "net/url"