Set freezelog to nil after closing it. Also rearrange some of the imports based on go fmt rules

This commit is contained in:
Ola Bini 2019-12-20 22:18:59 +00:00
parent 4a90b31d8d
commit ea2903c6b9
No known key found for this signature in database
GPG key ID: 6786A150F6A2B28F
3 changed files with 14 additions and 8 deletions

View file

@ -6,19 +6,20 @@ package main
import (
"errors"
"github.com/golang/protobuf/proto"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"strconv"
"time"
"github.com/golang/protobuf/proto"
"mumble.info/grumble/pkg/acl"
"mumble.info/grumble/pkg/ban"
"mumble.info/grumble/pkg/freezer"
"mumble.info/grumble/pkg/mumbleproto"
"mumble.info/grumble/pkg/serverconf"
"os"
"path/filepath"
"strconv"
"time"
)
// Freeze a server to disk and closes the log file.
@ -48,6 +49,7 @@ func (server *Server) openFreezeLog() error {
if err != nil {
return err
}
server.freezelog = nil
}
logfn := filepath.Join(Args.DataDir, "servers", strconv.FormatInt(server.Id, 10), "log.fz")

View file

@ -7,11 +7,12 @@
package main
import (
"github.com/golang/protobuf/proto"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"github.com/golang/protobuf/proto"
)
func (server *Server) freezeToFile() (err error) {
@ -21,6 +22,7 @@ func (server *Server) freezeToFile() (err error) {
if err != nil {
return err
}
server.freezelog = nil
}
// Make sure the whole server is synced to disk

View file

@ -5,12 +5,13 @@
package main
import (
"github.com/golang/protobuf/proto"
"io/ioutil"
"mumble.info/grumble/pkg/replacefile"
"os"
"path/filepath"
"strconv"
"github.com/golang/protobuf/proto"
"mumble.info/grumble/pkg/replacefile"
)
func (server *Server) freezeToFile() (err error) {
@ -20,6 +21,7 @@ func (server *Server) freezeToFile() (err error) {
if err != nil {
return err
}
server.freezelog = nil
}
// Make sure the whole server is synced to disk