File tree Expand file tree Collapse file tree 3 files changed +444
-0
lines changed
Expand file tree Collapse file tree 3 files changed +444
-0
lines changed Original file line number Diff line number Diff line change 66
77 "github.com/robfig/cron/v3"
88
9+ openai_api "aimodels-prices/cron/openai-api"
910 openrouter_api "aimodels-prices/cron/openrouter-api"
1011 price_audit "aimodels-prices/cron/price-audit"
1112 siliconflow_api "aimodels-prices/cron/siliconflow-api"
@@ -38,6 +39,12 @@ func Init() {
3839 if err := siliconflow_api .UpdateSiliconFlowPrices (); err != nil {
3940 log .Printf ("SiliconFlow价格更新任务执行失败: %v" , err )
4041 }
42+
43+ time .Sleep (3 * time .Second )
44+
45+ if err := openai_api .FetchAndSavePrices (); err != nil {
46+ log .Printf ("OpenAI官网价格获取任务执行失败: %v" , err )
47+ }
4148 })
4249
4350 if err != nil {
@@ -82,6 +89,13 @@ func Init() {
8289 if err := siliconflow_api .UpdateSiliconFlowPrices (); err != nil {
8390 log .Printf ("初始SiliconFlow价格更新任务执行失败: %v" , err )
8491 }
92+
93+ // 等待几秒后执行OpenAI官网价格获取任务
94+ time .Sleep (3 * time .Second )
95+ log .Println ("立即执行OpenAI官网价格获取任务..." )
96+ if err := openai_api .FetchAndSavePrices (); err != nil {
97+ log .Printf ("初始OpenAI官网价格获取任务执行失败: %v" , err )
98+ }
8599 }()
86100}
87101
You can’t perform that action at this time.
0 commit comments