Add hourly Alpha token cache refresh
Build Docker Image / build (amd64) (push) Successful in 58s

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-25 01:58:50 +07:00
parent ced55e5f16
commit c5c1cdf0d5
+13 -4
View File
@@ -33,9 +33,18 @@ func NewMarketData() *MarketData {
}
_ = ms.StartFutureWsMarkPrice()
_ = ms.StartSpotWsMarkPrice()
// Initialize Alpha token cache
go ms.refreshAlphaTokenCache()
// Initialize Alpha token cache and refresh every hour
go ms.alphaCacheRefreshLoop()
return ms
}
func (ms *MarketData) alphaCacheRefreshLoop() {
ms.refreshAlphaTokenCache()
ticker := time.NewTicker(time.Hour)
defer ticker.Stop()
for range ticker.C {
ms.refreshAlphaTokenCache()
}
}