Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-group
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-group
Commits
5f47802c
Commit
5f47802c
authored
Aug 23, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
group support
parent
07123285
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
send_gift_redis.go
cron/gift_cron/send_gift_redis.go
+6
-4
No files found.
cron/gift_cron/send_gift_redis.go
View file @
5f47802c
...
@@ -101,7 +101,9 @@ func groupSupportAddConsume(model *domain.Model, sendGiftEvent *gift_ev.SendGift
...
@@ -101,7 +101,9 @@ func groupSupportAddConsume(model *domain.Model, sendGiftEvent *gift_ev.SendGift
//if time.Now().Unix() <= 1692964800 { // cwj----
//if time.Now().Unix() <= 1692964800 { // cwj----
// return nil
// return nil
//}
//}
model
.
Log
.
Infof
(
"groupSupportAddConsume UserId:%d, sendGiftEvent:%+v"
,
sendGiftEvent
.
SendUserId
,
sendGiftEvent
)
if
sendGiftEvent
.
SceneType
!=
gift_e
.
GroupSceneType
||
sendGiftEvent
.
SceneUid
==
""
{
if
sendGiftEvent
.
SceneType
!=
gift_e
.
GroupSceneType
||
sendGiftEvent
.
SceneUid
==
""
{
model
.
Log
.
Infof
(
"groupSupportAddConsume UserId:%d, sendGiftEvent:%+v"
,
sendGiftEvent
.
SendUserId
,
sendGiftEvent
)
return
return
}
}
_
,
_
,
period
:=
group_m
.
GetSupportLevelTime
(
time
.
Now
())
_
,
_
,
period
:=
group_m
.
GetSupportLevelTime
(
time
.
Now
())
...
@@ -110,23 +112,23 @@ func groupSupportAddConsume(model *domain.Model, sendGiftEvent *gift_ev.SendGift
...
@@ -110,23 +112,23 @@ func groupSupportAddConsume(model *domain.Model, sendGiftEvent *gift_ev.SendGift
keyDiamond
:=
rediskey
.
GetGroupSupportConsumeSummary
(
period
)
keyDiamond
:=
rediskey
.
GetGroupSupportConsumeSummary
(
period
)
_
,
err
:=
model
.
RedisCluster
.
ZIncrBy
(
context
.
Background
(),
keyDiamond
,
float64
(
diamond
),
sendGiftEvent
.
SceneUid
)
.
Result
()
_
,
err
:=
model
.
RedisCluster
.
ZIncrBy
(
context
.
Background
(),
keyDiamond
,
float64
(
diamond
),
sendGiftEvent
.
SceneUid
)
.
Result
()
if
err
!=
nil
{
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"
AddSendGiftEventAsync groupSupport
key:%s, val:%d, member:%s, err:%v"
,
model
.
Log
.
Errorf
(
"
groupSupportAddConsume
key:%s, val:%d, member:%s, err:%v"
,
keyDiamond
,
diamond
,
sendGiftEvent
.
SceneUid
,
err
)
keyDiamond
,
diamond
,
sendGiftEvent
.
SceneUid
,
err
)
}
}
err
=
redisCli
.
SetExpire
(
model
.
RedisCluster
,
keyDiamond
,
time
.
Hour
*
24
*
14
)
// 保留两周
err
=
redisCli
.
SetExpire
(
model
.
RedisCluster
,
keyDiamond
,
time
.
Hour
*
24
*
14
)
// 保留两周
if
err
!=
nil
{
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"
AddSendGiftEventAsync groupSupport
key:%s, val:%d, member:%s, err:%v"
,
model
.
Log
.
Errorf
(
"
groupSupportAddConsume
key:%s, val:%d, member:%s, err:%v"
,
keyDiamond
,
diamond
,
sendGiftEvent
.
SceneUid
,
err
)
keyDiamond
,
diamond
,
sendGiftEvent
.
SceneUid
,
err
)
}
}
// 支持者数量
// 支持者数量
keySupportNum
:=
rediskey
.
GetGroupSupportCountSupporter
(
period
,
sendGiftEvent
.
SceneUid
)
keySupportNum
:=
rediskey
.
GetGroupSupportCountSupporter
(
period
,
sendGiftEvent
.
SceneUid
)
err
=
model
.
RedisCluster
.
SAdd
(
context
.
Background
(),
keySupportNum
,
sendGiftEvent
.
SendUserId
)
.
Err
()
err
=
model
.
RedisCluster
.
SAdd
(
context
.
Background
(),
keySupportNum
,
sendGiftEvent
.
SendUserId
)
.
Err
()
if
err
!=
nil
{
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"
AddSendGiftEventAsync groupSupport
key:%s, UserId:%d, err:%v"
,
keySupportNum
,
sendGiftEvent
.
SendUserId
,
err
)
model
.
Log
.
Errorf
(
"
groupSupportAddConsume
key:%s, UserId:%d, err:%v"
,
keySupportNum
,
sendGiftEvent
.
SendUserId
,
err
)
}
}
err
=
redisCli
.
SetExpire
(
model
.
RedisCluster
,
keySupportNum
,
time
.
Hour
*
24
*
14
)
// 保留两周
err
=
redisCli
.
SetExpire
(
model
.
RedisCluster
,
keySupportNum
,
time
.
Hour
*
24
*
14
)
// 保留两周
if
err
!=
nil
{
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"
AddSendGiftEventAsync groupSupport
key:%s, UserId:%d, err:%v"
,
keySupportNum
,
sendGiftEvent
.
SendUserId
,
err
)
model
.
Log
.
Errorf
(
"
groupSupportAddConsume
key:%s, UserId:%d, err:%v"
,
keySupportNum
,
sendGiftEvent
.
SendUserId
,
err
)
}
}
return
return
}
}
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