1
0
Çatalla 0
şundan çatallanmış boyska/circolog

more signals handled

Bu işleme şunda yer alıyor:
boyska 2018-11-10 17:41:45 +01:00
ebeveyn c70e28ff27
işleme 86bdeed4a2

Dosyayı Görüntüle

@ -3,10 +3,12 @@ package main
import (
"flag"
"fmt"
"log"
"net"
"net/http"
"os"
"os/signal"
"syscall"
"git.lattuga.net/boyska/circolog"
syslog "gopkg.in/mcuadros/go-syslog.v2"
@ -29,7 +31,7 @@ func main() {
flag.Parse()
interrupt := make(chan os.Signal, 1)
signal.Notify(interrupt, os.Interrupt)
signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM)
hub := circolog.NewHub(*bufsize)
handler := syslog.NewChannelHandler(hub.LogMessages)
@ -85,7 +87,8 @@ func main() {
for {
select {
case <-interrupt:
case sig := <-interrupt:
log.Println("Quitting because of signal", sig)
server.Kill()
if err := httpServer.Close(); err != nil {
fmt.Fprintln(os.Stderr, "Error closing http server:", err)