phase-8g: add sqllite.
This commit is contained in:
@@ -20,7 +20,11 @@ export class YahooFinanceClient {
|
||||
const normalised = YahooFinanceClient.normalise(ticker);
|
||||
for (let attempt = 0; attempt < retries; attempt++) {
|
||||
try {
|
||||
return await this.lib.quoteSummary(normalised, { modules: YAHOO_MODULES });
|
||||
return await this.lib.quoteSummary(
|
||||
normalised,
|
||||
{ modules: YAHOO_MODULES },
|
||||
{ validateResult: false },
|
||||
);
|
||||
} catch (error) {
|
||||
if (attempt === retries - 1) throw error;
|
||||
await new Promise<void>((resolve) => setTimeout(resolve, backoff * (attempt + 1)));
|
||||
@@ -30,9 +34,11 @@ export class YahooFinanceClient {
|
||||
|
||||
async fetchCalendarEvents(ticker: string): Promise<any | null> {
|
||||
try {
|
||||
const result = await this.lib.quoteSummary(YahooFinanceClient.normalise(ticker), {
|
||||
modules: ['calendarEvents'],
|
||||
});
|
||||
const result = await this.lib.quoteSummary(
|
||||
YahooFinanceClient.normalise(ticker),
|
||||
{ modules: ['calendarEvents'] },
|
||||
{ validateResult: false },
|
||||
);
|
||||
return result.calendarEvents ?? null;
|
||||
} catch {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user