MCPcopy Index your code
hub / github.com/massCodeIO/massCode / refreshCryptoRatesForced

Function refreshCryptoRatesForced

src/main/currencyRates.ts:187–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

185}
186
187export async function refreshCryptoRatesForced(): Promise<CurrencyRatesPayload> {
188 const cryptoRates = await fetchCryptoRates()
189 const cached = store.currencyRates.get('cache')
190
191 if (!cached) {
192 return createPayload(cryptoRates)
193 }
194
195 const payload = createPayload({ ...cached.rates, ...cryptoRates })
196 store.currencyRates.set('cache', {
197 rates: payload.rates,
198 fetchedAt: payload.fetchedAt,
199 })
200
201 return payload
202}

Callers 1

registerSystemHandlersFunction · 0.90

Calls 4

fetchCryptoRatesFunction · 0.85
createPayloadFunction · 0.85
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected