Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
ichunt_golang_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4dd0428d
authored
Jun 02, 2021
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
5b340abf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
app/dao/dao.go
app/dao/dao.go
View file @
4dd0428d
package
dao
package
dao
import
(
import
(
"fmt"
"time"
"sync"
"sync"
"time"
"xorm.io/xorm"
"xorm.io/xorm"
redisPool
"github.com/ichunt2019/go-redis-pool"
"github.com/go-redis/redis/v7"
"github.com/go-redis/redis/v7"
_
"github.com/go-sql-driver/mysql"
_
"github.com/go-sql-driver/mysql"
"github.com/ichunt2019/cfg/lib"
"github.com/ichunt2019/cfg/lib"
redisPool
"github.com/ichunt2019/go-redis-pool"
"ichunt_golang/app/common/config"
"ichunt_golang/app/common/config"
)
)
...
@@ -84,7 +83,7 @@ func mysqlSetup(d *dao) *dao {
...
@@ -84,7 +83,7 @@ func mysqlSetup(d *dao) *dao {
func
redisSetup
(
d
*
dao
)
*
dao
{
func
redisSetup
(
d
*
dao
)
*
dao
{
var
err
error
var
err
error
redisGroupList
:=
config
.
BuildRedisGroupConfigs
()
redisGroupList
:=
config
.
BuildRedisGroupConfigs
()
fmt
.
Println
(
redisGroupList
)
//
fmt.Println(redisGroupList)
for
redisServerName
,
redisInfo
:=
range
redisGroupList
{
for
redisServerName
,
redisInfo
:=
range
redisGroupList
{
d
.
redisGroup
[
redisServerName
],
err
=
redisPool
.
NewHA
(
&
redisPool
.
HAConfig
{
d
.
redisGroup
[
redisServerName
],
err
=
redisPool
.
NewHA
(
&
redisPool
.
HAConfig
{
Master
:
redisInfo
.
MasterHost
,
Master
:
redisInfo
.
MasterHost
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment