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) {
465
465
//检查新版本
466
466
go func () {
467
467
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 )
473
469
474
470
a .cron .AddFunc ("0 0 2 * * *" , func () {
475
471
logger .SugaredLogger .Errorf ("Checking for updates..." )
@@ -524,6 +520,11 @@ func (a *App) CheckStockBaseInfo(ctx context.Context) {
524
520
SetResult (stockBasics ).
525
521
Get ("http://8.134.249.145:18080/go-stock/stock_basic.json" )
526
522
523
+ count := int64 (0 )
524
+ db .Dao .Model (& data.StockBasic {}).Count (& count )
525
+ if count == int64 (len (* stockBasics )) {
526
+ return
527
+ }
527
528
for _ , stock := range * stockBasics {
528
529
stockInfo := & data.StockBasic {
529
530
TsCode : stock .TsCode ,
You can’t perform that action at this time.
0 commit comments