Skip to content

Commit

Permalink
👌 chore: added pid connection #1
Browse files Browse the repository at this point in the history
  • Loading branch information
pnguyen215 committed Jun 25, 2023
1 parent c77e762 commit 182096c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/sivaosorg/redisconn

go 1.20

require github.com/sivaosorg/govm v1.0.3
require github.com/sivaosorg/govm v1.0.4

require (
github.com/BurntSushi/toml v1.3.2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sivaosorg/govm v1.0.3 h1:yfdhD0Pl8t1ey/VT/085BwK1Cy5gFv1Qztynx0zPGzA=
github.com/sivaosorg/govm v1.0.3/go.mod h1:ymisVMkS/ouMgb7Wjaa7xVkqz7LLrh5SZOr0Q3V2Ogc=
github.com/sivaosorg/govm v1.0.4 h1:Fwpnh9J7pw51erL4V531VqVCWAUKZh25T/hla5cAS3c=
github.com/sivaosorg/govm v1.0.4/go.mod h1:ymisVMkS/ouMgb7Wjaa7xVkqz7LLrh5SZOr0Q3V2Ogc=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
Expand Down
4 changes: 3 additions & 1 deletion redisconn/redisconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package redisconn

import (
"fmt"
"os"

"github.com/go-redis/redis"
"github.com/sivaosorg/govm/dbx"
Expand Down Expand Up @@ -41,6 +42,7 @@ func NewClient(config redisx.RedisConfig) (*redis.Client, dbx.Dbx) {
_logger.Info(fmt.Sprintf("Connected successfully to redis cache:: %s/%s", config.UrlConn, config.Database))
}
instance = client
s.SetConnected(true).SetMessage("Connection established")
pid := os.Getpid()
s.SetConnected(true).SetMessage("Connection established").SetPid(pid).SetNewInstance(true)
return instance, *s
}

0 comments on commit 182096c

Please sign in to comment.