mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-19 21:59:59 -08:00
Set freezelog to nil after closing it. Also rearrange some of the imports based on go fmt rules
This commit is contained in:
parent
4a90b31d8d
commit
ea2903c6b9
3 changed files with 14 additions and 8 deletions
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue