Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-socketCenter
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujiebin
hilo-socketCenter
Compare Revisions
master_20231023...master
Source
master
Select Git revision
...
Target
master_20231023
Select Git revision
Compare
Commits (8)
feat:去掉consul
· 766ed27e
hujiebin
authored
Oct 23, 2023
766ed27e
Merge branch 'feature/consul-redis' into 'master'
· 408095d4
hujiebin
authored
Oct 23, 2023
feat:去掉consul See merge request
!1
408095d4
rm
· 408f24cc
hujiebin
authored
Oct 23, 2023
408f24cc
Update release.ini
· f8a02c60
hujiebin
authored
Oct 26, 2023
f8a02c60
feat:优化告警
· 833f2a9b
hujiebin
authored
Dec 04, 2023
833f2a9b
Update userProxy.proto
· a02e1a3f
hujiebin
authored
Apr 15, 2024
a02e1a3f
Merge branch 'feature/svip89' into 'master'
· 56504493
hujiebin
authored
Apr 15, 2024
Update userProxy.proto See merge request
!2
56504493
feat:去掉无用日志
· ac233b61
hujiebin
authored
May 09, 2024
ac233b61
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
53 deletions
+47
-53
debug.ini
debug.ini
+10
-10
local.ini
local.ini
+10
-10
main.go
main.go
+18
-25
userProxy.proto
protocol/userProxy.proto
+1
-0
release.ini
release.ini
+8
-8
No files found.
debug.ini
View file @
ac233b61
[DATABASE]
[DATABASE]
MYSQL_HOST
=
47.244.34.27:3306
MYSQL_HOST
=
hk-cynosdbmysql-grp-a3wqck8p.sql.tencentcdb.com:22303
MYSQL_USERNAME
=
roo
t
MYSQL_USERNAME
=
hilo_tes
t
MYSQL_PASSWORD
=
yX0jPAhO0I4s2zlA
MYSQL_PASSWORD
=
cPsTMSA9szQ6B9Y2zFXSvpDdduB8kZxC
MYSQL_DB
=
hilo
MYSQL_DB
=
hilo
[DATABASECODE]
[DATABASECODE]
MYSQL_HOST
=
47.244.34.27:3306
MYSQL_HOST
=
hk-cynosdbmysql-grp-a3wqck8p.sql.tencentcdb.com:22303
MYSQL_USERNAME
=
roo
t
MYSQL_USERNAME
=
hilo_tes
t
MYSQL_PASSWORD
=
yX0jPAhO0I4s2zlA
MYSQL_PASSWORD
=
cPsTMSA9szQ6B9Y2zFXSvpDdduB8kZxC
MYSQL_DB
=
hilo_code
MYSQL_DB
=
hilo_code
[REDIS]
[REDIS]
REDIS_HOST
=
47.244.34.27
:6379
REDIS_HOST
=
172.19.0.2
:6379
REDIS_PASSWORD
=
8QZ9JD1zLvPR3yHf
REDIS_PASSWORD
=
yPyZH1DYMJhrVQgr
REDIS_CLUSTER_HOST
=
47.244.34.27
:6379
REDIS_CLUSTER_HOST
=
172.19.0.2
:6379
REDIS_CLUSTER_PASSWORD
=
8QZ9JD1zLvPR3yHf
REDIS_CLUSTER_PASSWORD
=
yPyZH1DYMJhrVQgr
[JWT]
[JWT]
SECRET
=
hilo1632
SECRET
=
hilo1632
ISSUER_API
=
hiloApi
ISSUER_API
=
hiloApi
...
...
local.ini
View file @
ac233b61
[DATABASE]
[DATABASE]
MYSQL_HOST
=
47.244.34.27:3306
MYSQL_HOST
=
hk-cynosdbmysql-grp-a3wqck8p.sql.tencentcdb.com:22303
MYSQL_USERNAME
=
roo
t
MYSQL_USERNAME
=
hilo_tes
t
MYSQL_PASSWORD
=
yX0jPAhO0I4s2zlA
MYSQL_PASSWORD
=
cPsTMSA9szQ6B9Y2zFXSvpDdduB8kZxC
MYSQL_DB
=
hilo
MYSQL_DB
=
hilo
[DATABASECODE]
[DATABASECODE]
MYSQL_HOST
=
47.244.34.27:3306
MYSQL_HOST
=
hk-cynosdbmysql-grp-a3wqck8p.sql.tencentcdb.com:22303
MYSQL_USERNAME
=
roo
t
MYSQL_USERNAME
=
hilo_tes
t
MYSQL_PASSWORD
=
yX0jPAhO0I4s2zlA
MYSQL_PASSWORD
=
cPsTMSA9szQ6B9Y2zFXSvpDdduB8kZxC
MYSQL_DB
=
hilo_code
MYSQL_DB
=
hilo_code
[REDIS]
[REDIS]
REDIS_HOST
=
47.244.34.27
:6379
REDIS_HOST
=
172.19.0.2
:6379
REDIS_PASSWORD
=
8QZ9JD1zLvPR3yHf
REDIS_PASSWORD
=
yPyZH1DYMJhrVQgr
REDIS_CLUSTER_HOST
=
47.244.34.27
:6379
REDIS_CLUSTER_HOST
=
172.19.0.2
:6379
REDIS_CLUSTER_PASSWORD
=
8QZ9JD1zLvPR3yHf
REDIS_CLUSTER_PASSWORD
=
yPyZH1DYMJhrVQgr
[JWT]
[JWT]
SECRET
=
hilo1632
SECRET
=
hilo1632
ISSUER_API
=
hiloApi
ISSUER_API
=
hiloApi
...
...
main.go
View file @
ac233b61
...
@@ -6,14 +6,11 @@ import (
...
@@ -6,14 +6,11 @@ import (
"fmt"
"fmt"
"github.com/go-redis/redis/v8"
"github.com/go-redis/redis/v8"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/proto"
"github.com/hashicorp/consul/api"
"google.golang.org/grpc"
"google.golang.org/grpc"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/resolver"
"google.golang.org/grpc/resolver"
"google.golang.org/grpc/resolver/manual"
"google.golang.org/grpc/resolver/manual"
"hilo-socketCenter/common"
"hilo-socketCenter/common"
"hilo-socketCenter/common/consul"
"hilo-socketCenter/common/dingding"
"hilo-socketCenter/common/mylogrus"
"hilo-socketCenter/common/mylogrus"
"hilo-socketCenter/common/redisCli"
"hilo-socketCenter/common/redisCli"
"hilo-socketCenter/domain/model/rpc_m"
"hilo-socketCenter/domain/model/rpc_m"
...
@@ -43,24 +40,22 @@ var kacp = keepalive.ClientParameters{
...
@@ -43,24 +40,22 @@ var kacp = keepalive.ClientParameters{
// 初始化userCenterClient
// 初始化userCenterClient
func
init
()
{
func
init
()
{
client
,
err
:=
api
.
NewClient
(
api
.
DefaultConfig
())
//非默认情况下需要设置实际的参数
redisKey
:=
fmt
.
Sprintf
(
"service:userCenter"
)
ipPorts
,
err
:=
redisCli
.
GetRedisCluster
()
.
ZRangeByScore
(
context
.
Background
(),
redisKey
,
&
redis
.
ZRangeBy
{
Min
:
fmt
.
Sprintf
(
"%d"
,
time
.
Now
()
.
Add
(
-
time
.
Second
*
15
)
.
Unix
()),
// 3倍心跳
Max
:
"+inf"
,
})
.
Result
()
if
err
!=
nil
{
if
err
!=
nil
{
mylogrus
.
MyLog
.
Fatalln
(
err
)
failMsg
:=
fmt
.
Sprintf
(
"get service fail,svc:%v,err:%v"
,
"userCenter"
,
err
)
mylogrus
.
MyLog
.
Errorf
(
failMsg
)
}
else
if
len
(
ipPorts
)
>
0
{
}
}
cataLog
:=
client
.
Catalog
()
if
len
(
ipPorts
)
<=
0
{
if
cataLog
==
nil
{
ipPorts
=
[]
string
{
"127.0.0.1:50040"
}
mylogrus
.
MyLog
.
Fatalln
(
"No catalog."
)
}
addr
,
err
:=
consul
.
GetServices
(
cataLog
,
"userCenter"
)
if
err
!=
nil
{
mylogrus
.
MyLog
.
Fatalln
(
err
)
}
if
len
(
addr
)
==
0
{
mylogrus
.
MyLog
.
Fatalln
(
"No userCenter available."
)
}
}
addresses
:=
make
([]
resolver
.
Address
,
len
(
addr
))
addresses
:=
make
([]
resolver
.
Address
,
len
(
ipPorts
))
for
i
,
s
:=
range
addr
{
for
i
,
s
:=
range
ipPorts
{
addresses
[
i
]
.
Addr
=
s
addresses
[
i
]
.
Addr
=
s
mylogrus
.
MyLog
.
Infof
(
"address : %s"
,
s
)
mylogrus
.
MyLog
.
Infof
(
"address : %s"
,
s
)
}
}
...
@@ -117,17 +112,15 @@ func check() {
...
@@ -117,17 +112,15 @@ func check() {
mylogrus
.
MyLog
.
Infof
(
"cron sendGiftChan msg error,left %v-%v"
,
l
,
err
)
mylogrus
.
MyLog
.
Infof
(
"cron sendGiftChan msg error,left %v-%v"
,
l
,
err
)
}
}
if
l
>
MONITOR_LENGTH
{
if
l
>
MONITOR_LENGTH
{
go
func
()
{
mylogrus
.
MyLog
.
Infof
(
"送礼横幅变化通知延迟,队列%s长度:%d"
,
SocketQueueSendGift
,
l
)
if
sErr
:=
dingding
.
SendDingRobot
(
dingding
.
ROBOTWEBHOOK
,
fmt
.
Sprintf
(
"送礼横幅变化通知延迟,队列%s长度:%d"
,
SocketQueueSendGift
,
l
),
true
);
sErr
!=
nil
{
//go func() {
mylogrus
.
MyLog
.
Errorf
(
"dingding msg fail:%v"
,
sErr
)
// if sErr := dingding.SendDingRobot(dingding.ROBOTWEBHOOK, fmt.Sprintf("送礼横幅变化通知延迟,队列%s长度:%d", SocketQueueSendGift, l), true); sErr != nil {
}
// mylogrus.MyLog.Errorf("dingding msg fail:%v", sErr)
}()
// }
//}()
n
,
err
:=
redisCli
.
GetRedisCluster
()
.
Del
(
context
.
Background
(),
SocketQueueSendGift
)
.
Result
()
n
,
err
:=
redisCli
.
GetRedisCluster
()
.
Del
(
context
.
Background
(),
SocketQueueSendGift
)
.
Result
()
mylogrus
.
MyLog
.
Infof
(
"del sendGiftChan msg queue:%v,n:%v,err:%v"
,
SocketQueueSendGift
,
n
,
err
)
mylogrus
.
MyLog
.
Infof
(
"del sendGiftChan msg queue:%v,n:%v,err:%v"
,
SocketQueueSendGift
,
n
,
err
)
}
}
if
l
>
0
{
mylogrus
.
MyLog
.
Infof
(
"cron sendGiftChan msg,left %v"
,
l
)
}
}
}
}
}
}
}
...
...
protocol/userProxy.proto
View file @
ac233b61
...
@@ -214,6 +214,7 @@ message GlobalGiftBanner {
...
@@ -214,6 +214,7 @@ message GlobalGiftBanner {
uint32
cpLevel
=
15
;
// cp等级
uint32
cpLevel
=
15
;
// cp等级
string
receiveUserAvatar
=
16
;
string
receiveUserAvatar
=
16
;
uint32
nobleLevel
=
17
;
// 贵族等级
uint32
nobleLevel
=
17
;
// 贵族等级
string
custom_effect_url
=
18
;
// 定制特效url
}
}
/* id == 116 横幅的回应,用来测量RTT */
/* id == 116 横幅的回应,用来测量RTT */
...
...
release.ini
View file @
ac233b61
[DATABASE]
[DATABASE]
MYSQL_HOST
=
ua4papc3hmgqf351pbej-rw4rm.rwlb.dubai.rds.aliyuncs.com
MYSQL_HOST
=
172.28.16.44
MYSQL_USERNAME
=
nextvideo
MYSQL_USERNAME
=
hilo_master
MYSQL_PASSWORD
=
ihlUwI4nhi9W88MI
MYSQL_PASSWORD
=
o8NNd8F7e6On2RqIgOhsy1PsiSxROT3n
MYSQL_DB
=
hilo
MYSQL_DB
=
hilo
[DATABASECODE]
[DATABASECODE]
MYSQL_HOST
=
ua4papc3hmgqf351pbej-rw4rm.rwlb.dubai.rds.aliyuncs.com
MYSQL_HOST
=
172.28.16.44
MYSQL_USERNAME
=
nextvideo
MYSQL_USERNAME
=
hilo_master
MYSQL_PASSWORD
=
ihlUwI4nhi9W88MI
MYSQL_PASSWORD
=
o8NNd8F7e6On2RqIgOhsy1PsiSxROT3n
MYSQL_DB
=
hilo_code
MYSQL_DB
=
hilo_code
[REDIS]
[REDIS]
REDIS_HOST
=
r-eb3btxn8vfdsuwdbuf.redis.dubai.rds.aliyuncs.com
:6379
REDIS_HOST
=
172.28.16.31
:6379
REDIS_PASSWORD
=
REDIS_PASSWORD
=
REDIS_CLUSTER_HOST
=
r-eb3yt6k8zgxs62kjjs.redis.dubai.rds.aliyuncs.com
:6379
REDIS_CLUSTER_HOST
=
172.28.16.47
:6379
REDIS_CLUSTER_PASSWORD
=
REDIS_CLUSTER_PASSWORD
=
[JWT]
[JWT]
SECRET
=
hilo1504
SECRET
=
hilo1504
...
...