Shutdown raters on inquirer exit

This commit is contained in:
Radu Ioan Fericean
2012-01-28 17:59:16 +02:00
parent ff4b12e329
commit a80a234467
2 changed files with 9 additions and 0 deletions

View File

@@ -42,6 +42,8 @@ func main() {
rpc.Register(raterServer)
rpc.HandleHTTP()
go StopSingnalHandler()
responder := new(Responder)
srvr := rpc.NewServer()
srvr.Register(responder)

View File

@@ -27,6 +27,13 @@ func (s *Storage) Get(args string, reply *string) (err error) {
return err
}
func (s *Storage) Shutdown(args string, reply *string) (err error) {
s.sg.Close()
defer os.Exit(0)
*reply = "Done!"
return nil
}
func main() {
flag.Parse()
getter, err := NewKyotoStorage("storage.kch")