Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
bom_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
d9150ce3
authored
Mar 16, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加时间间隔
parent
ce726eaf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
internal/logic/match.go
internal/logic/search.go
internal/logic/match.go
View file @
d9150ce3
...
...
@@ -6,6 +6,7 @@ import (
"bom_server/internal/model"
"math"
"sync"
"time"
"github.com/prometheus/common/log"
es
"gopkg.in/olivere/elastic.v5"
...
...
@@ -52,6 +53,7 @@ func MatchGoods(message model.BomMessage) (err error) {
}
else
{
bomData
=
bomItems
[
i
:
i
+
perGoDealNumber
]
}
time
.
Sleep
(
100
*
time
.
Millisecond
)
go
func
()
{
if
len
(
bomData
)
!=
0
{
if
err
:=
SearchGoods
(
bomId
,
bomData
,
message
.
DeliveryType
,
message
.
Sort
,
&
wg
);
err
!=
nil
{
...
...
internal/logic/search.go
View file @
d9150ce3
...
...
@@ -35,6 +35,8 @@ func search(index string, bomId int, bomItems []model.BomItem, deliveryType, sor
//构建一个goods_name对应的bomItems列表
searchRequest
:=
getSearchParams
(
index
,
bom
,
sort
,
paramsRawSearch
)
searchFlag
=
true
//randInt := rand.Intn(10)
//time.Sleep(10 * time.Millisecond)
search
.
Add
(
searchRequest
)
}
//没有搜索条件的话,直接返回空值即可
...
...
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