Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CnChunfeng
/
crm_server
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
9ca03009
authored
Apr 23, 2020
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
睡眠
parent
8fd9c05a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
cmd/queue/update_user_sale/main.go
cmd/queue/user_add/main.go
cmd/queue/update_user_sale/main.go
View file @
9ca03009
...
...
@@ -86,7 +86,7 @@ func handle(userId,saleId int)(result bool) {
//不存在推一个队列,然后停止2秒,再检查
user_add_queue_logic
.
PushUserQueue
(
userId
)
time
.
Sleep
(
2
*
time
.
Second
)
time
.
Sleep
(
8
*
time
.
Second
)
_
=
dao
.
GetDb
()
.
QueryRowx
(
"select user_id from lie_user where outter_uid = ?"
,
userId
)
.
Scan
(
&
crmUserId
)
if
crmUserId
==
0
{
...
...
cmd/queue/user_add/main.go
View file @
9ca03009
...
...
@@ -11,6 +11,7 @@ import (
"github.com/streadway/amqp"
"log"
"strconv"
"time"
)
var
(
...
...
@@ -72,6 +73,7 @@ func main(){
go
func
()
{
for
d
:=
range
msgs
{
time
.
Sleep
(
5
*
time
.
Second
)
json
.
Unmarshal
(
d
.
Body
,
&
user
)
fmt
.
Println
(
user
)
handle
(
user
.
User_Id
)
...
...
@@ -85,6 +87,7 @@ func main(){
func
handle
(
memberId
int
)(
result
bool
)
{
time
.
Sleep
(
5
*
time
.
Second
)
//获取当前会员的基本数据
InsertData
=
logic
.
GetMemberUserInfo
(
memberId
)
...
...
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