Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-userCenter
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-userCenter
Commits
0e434326
Commit
0e434326
authored
Aug 18, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
继续减少日志
parent
78f77d43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
main.go
main.go
+5
-6
No files found.
main.go
View file @
0e434326
...
...
@@ -9,7 +9,6 @@ import (
"net/url"
"os"
"strconv"
"strings"
"time"
"github.com/go-redis/redis/v8"
...
...
@@ -216,10 +215,10 @@ func (s *server) Broadcast(ctx context.Context, in *userCenter.BroadcastMessage)
}
for
addr
,
users
:=
range
m
{
//addr = strings.Replace(addr, "47.91.121.73", "172.26.95.24", -1)
mylogrus
.
MyLog
.
Infof
(
"Broadcasting: Addr %s: %d users"
,
addr
,
len
(
users
))
if
!
strings
.
Contains
(
addr
,
"172.26.95.48:50050"
)
&&
!
strings
.
Contains
(
addr
,
"172.26.95.24:50050"
)
{
mylogrus
.
MyLog
.
Errorf
(
"Broadcasting: Addr error %s: %d users"
,
addr
,
len
(
users
))
}
//
mylogrus.MyLog.Infof("Broadcasting: Addr %s: %d users", addr, len(users))
//
if !strings.Contains(addr, "172.26.95.48:50050") && !strings.Contains(addr, "172.26.95.24:50050") {
//
mylogrus.MyLog.Errorf("Broadcasting: Addr error %s: %d users", addr, len(users))
//
}
const
sendBatchSize
=
5
for
i
:=
0
;
i
<
len
(
users
);
i
+=
sendBatchSize
{
...
...
@@ -296,7 +295,7 @@ func (s *server) GetLastRoomHeartbeat(ctx context.Context, in *userCenter.GetLas
}
func
realBroadcast
(
addr
string
,
uids
[]
uint64
,
msg
*
userCenter
.
BroadcastMessage
)
{
mylogrus
.
MyLog
.
Infof
(
"Broadcasting: Addr %s: users: %v"
,
addr
,
uids
)
//
mylogrus.MyLog.Infof("Broadcasting: Addr %s: users: %v", addr, uids)
for
_
,
uid
:=
range
uids
{
client
:=
manager
.
UserProxyMgr
.
MakeClient
(
addr
)
...
...
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