File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -465,11 +465,7 @@ func (a *App) domReady(ctx context.Context) {
465465 //检查新版本
466466 go func () {
467467 a .CheckUpdate (0 )
468- count := int64 (0 )
469- db .Dao .Model (& data.StockBasic {}).Count (& count )
470- if count <= 0 {
471- go a .CheckStockBaseInfo (a .ctx )
472- }
468+ go a .CheckStockBaseInfo (a .ctx )
473469
474470 a .cron .AddFunc ("0 0 2 * * *" , func () {
475471 logger .SugaredLogger .Errorf ("Checking for updates..." )
@@ -524,6 +520,11 @@ func (a *App) CheckStockBaseInfo(ctx context.Context) {
524520 SetResult (stockBasics ).
525521 Get ("http://8.134.249.145:18080/go-stock/stock_basic.json" )
526522
523+ count := int64 (0 )
524+ db .Dao .Model (& data.StockBasic {}).Count (& count )
525+ if count == int64 (len (* stockBasics )) {
526+ return
527+ }
527528 for _ , stock := range * stockBasics {
528529 stockInfo := & data.StockBasic {
529530 TsCode : stock .TsCode ,
You can’t perform that action at this time.
0 commit comments