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 (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
"mumble.info/grumble/pkg/acl"
|
"mumble.info/grumble/pkg/acl"
|
||||||
"mumble.info/grumble/pkg/ban"
|
"mumble.info/grumble/pkg/ban"
|
||||||
"mumble.info/grumble/pkg/freezer"
|
"mumble.info/grumble/pkg/freezer"
|
||||||
"mumble.info/grumble/pkg/mumbleproto"
|
"mumble.info/grumble/pkg/mumbleproto"
|
||||||
"mumble.info/grumble/pkg/serverconf"
|
"mumble.info/grumble/pkg/serverconf"
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
"strconv"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Freeze a server to disk and closes the log file.
|
// Freeze a server to disk and closes the log file.
|
||||||
|
|
@ -48,6 +49,7 @@ func (server *Server) openFreezeLog() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
server.freezelog = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
logfn := filepath.Join(Args.DataDir, "servers", strconv.FormatInt(server.Id, 10), "log.fz")
|
logfn := filepath.Join(Args.DataDir, "servers", strconv.FormatInt(server.Id, 10), "log.fz")
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,12 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (server *Server) freezeToFile() (err error) {
|
func (server *Server) freezeToFile() (err error) {
|
||||||
|
|
@ -21,6 +22,7 @@ func (server *Server) freezeToFile() (err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
server.freezelog = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the whole server is synced to disk
|
// Make sure the whole server is synced to disk
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,13 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"mumble.info/grumble/pkg/replacefile"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
|
"mumble.info/grumble/pkg/replacefile"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (server *Server) freezeToFile() (err error) {
|
func (server *Server) freezeToFile() (err error) {
|
||||||
|
|
@ -20,6 +21,7 @@ func (server *Server) freezeToFile() (err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
server.freezelog = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the whole server is synced to disk
|
// Make sure the whole server is synced to disk
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue