refine tenant api

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-04-01 02:59:19 +08:00
parent 744bd053e3
commit 93ad572e19
202 changed files with 13517 additions and 7951 deletions

View File

@@ -20,7 +20,10 @@ package redis
import (
"flag"
"log"
"os"
"os/signal"
"sync"
"syscall"
"github.com/go-redis/redis"
)
@@ -50,6 +53,12 @@ func Client() *redis.Client {
if err := redisClient.Ping().Err(); err != nil {
log.Fatalln(err)
}
c := make(chan os.Signal, 0)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func() {
<-c
redisClient.Close()
}()
})
return redisClient