Commit a9ad56b3 by Joneq

修复context超时

parent 36582d6c
Showing with 8 additions and 3 deletions
......@@ -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)
//插入数据
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment