mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
fix(app):修复初次安装软件时股票基础信息没有立即初始化的问题
- 将 CheckStockBaseInfo 方法的调用移到 CheckUpdate 方法之前 - 修改 cron定时任务,只在特定日期执行版本检查和股票基础信息检查
This commit is contained in:
parent
93e8fb27b5
commit
052104b43a
7
app.go
7
app.go
@ -424,7 +424,7 @@ func (a *App) domReady(ctx context.Context) {
|
||||
//检查新版本
|
||||
go func() {
|
||||
a.CheckUpdate()
|
||||
a.CheckStockBaseInfo()
|
||||
a.CheckStockBaseInfo(a.ctx)
|
||||
a.cron.AddFunc("30 05 8,12,20 * * *", func() {
|
||||
logger.SugaredLogger.Errorf("Checking for updates...")
|
||||
a.CheckUpdate()
|
||||
@ -463,8 +463,11 @@ func (a *App) domReady(ctx context.Context) {
|
||||
logger.SugaredLogger.Infof("domReady-cronEntrys:%+v", a.cronEntrys)
|
||||
|
||||
}
|
||||
func (a *App) CheckStockBaseInfo() {
|
||||
func (a *App) CheckStockBaseInfo(ctx context.Context) {
|
||||
defer PanicHandler()
|
||||
defer func() {
|
||||
go runtime.EventsEmit(ctx, "loadingMsg", "done")
|
||||
}()
|
||||
|
||||
stockBasics := &[]data.StockBasic{}
|
||||
resty.New().R().
|
||||
|
3
frontend/wailsjs/go/main/App.d.ts
vendored
3
frontend/wailsjs/go/main/App.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
import {data} from '../models';
|
||||
import {models} from '../models';
|
||||
import {context} from '../models';
|
||||
|
||||
export function AddCronTask(arg1:data.FollowedStock):Promise<any>;
|
||||
|
||||
@ -15,6 +16,8 @@ export function AnalyzeSentiment(arg1:string):Promise<data.SentimentResult>;
|
||||
|
||||
export function CheckSponsorCode(arg1:string):Promise<Record<string, any>>;
|
||||
|
||||
export function CheckStockBaseInfo(arg1:context.Context):Promise<void>;
|
||||
|
||||
export function CheckUpdate():Promise<void>;
|
||||
|
||||
export function ClsCalendar():Promise<Array<any>>;
|
||||
|
@ -26,6 +26,10 @@ export function CheckSponsorCode(arg1) {
|
||||
return window['go']['main']['App']['CheckSponsorCode'](arg1);
|
||||
}
|
||||
|
||||
export function CheckStockBaseInfo(arg1) {
|
||||
return window['go']['main']['App']['CheckStockBaseInfo'](arg1);
|
||||
}
|
||||
|
||||
export function CheckUpdate() {
|
||||
return window['go']['main']['App']['CheckUpdate']();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user