Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
kaopu-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
a9ad56b3
authored
Dec 02, 2019
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复context超时
parent
36582d6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
cmd/static/main.go
cmd/static/main.go
View file @
a9ad56b3
...
...
@@ -50,14 +50,16 @@ func main() {
flag
.
StringVar
(
&
runtype
,
"runtype"
,
"one"
,
"default config path"
)
go
insertRecord
()
svc
:=
service
.
New
()
c
:=
context
.
Background
()
if
runtype
==
"one"
{
//调用服务获取公司信息,然后进行全局赋值
svc
:=
service
.
New
()
c
:=
context
.
Background
()
companyData
,
_
=
svc
.
GetCompanyCresitsList
(
c
)
for
_
,
v
:=
range
companyData
{
c
:=
context
.
Background
()
insertScoreMsg
.
ComCreditsId
=
stringTurnInt64
(
v
[
"id"
])
getCompanyRunInfo
(
c
)
setSumScore
()
...
...
@@ -80,16 +82,19 @@ func main() {
func
setSumScore
()
{
com_credits
.
Id
=
insertScoreMsg
.
ComCreditsId
com_credits
.
StaticCreditScore
=
CompanyInfo
()
+
AddScore
()
+
HistoryBussiness
()
+
EnterPriseCredit
()
+
PersonalCredit
()
c
:=
context
.
Background
()
connect
:=
dao
.
New
()
connect
.
UpdateStaticSumScores
(
c
,
com_credits
)
}
//协程增加分值记录
func
insertRecord
()
{
ctx
:=
context
.
Background
()
for
insertScoreMsgRecord
:=
range
socreRecordChan
{
//声明service层
connect
:=
dao
.
New
()
ctx
:=
context
.
Background
()
//CurrentScore64 := float64(insertScoreMsgRecord.CurrentScore)
//插入数据
...
...
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