forked from External/grumble
Hook up new freezer code to the server.
This commit is contained in:
parent
ff299b8aa4
commit
eb4f3319fd
8 changed files with 744 additions and 447 deletions
|
|
@ -5,11 +5,8 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func SignalHandler() {
|
||||
|
|
@ -18,15 +15,6 @@ func SignalHandler() {
|
|||
if sig != os.SIGINT && sig != os.SIGTERM {
|
||||
continue
|
||||
}
|
||||
for sid, s := range servers {
|
||||
err := s.FreezeToFile(filepath.Join(*datadir, fmt.Sprintf("%v", sid)))
|
||||
if err != nil {
|
||||
log.Printf("Unable to freeze server %v: %s", sid, err.String())
|
||||
continue
|
||||
}
|
||||
log.Printf("Server %v frozen", sid)
|
||||
}
|
||||
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue