switched eod to new exchange way
This commit is contained in:
parent
f4366f7289
commit
7a99d08d04
7 changed files with 11 additions and 12 deletions
|
|
@ -59,7 +59,7 @@ export async function scheduleFetchCorporateActions(
|
|||
// Schedule dividends fetch
|
||||
await this.scheduleOperation('fetch-corporate-actions', {
|
||||
symbol: symbol.Code,
|
||||
exchange: symbol.Exchange,
|
||||
exchange: symbol.eodExchange || symbol.Exchange, // Use eodExchange if available
|
||||
actionType: 'dividends',
|
||||
country: symbol.Country
|
||||
}, {
|
||||
|
|
@ -75,7 +75,7 @@ export async function scheduleFetchCorporateActions(
|
|||
// Schedule splits fetch
|
||||
await this.scheduleOperation('fetch-corporate-actions', {
|
||||
symbol: symbol.Code,
|
||||
exchange: symbol.Exchange,
|
||||
exchange: symbol.eodExchange || symbol.Exchange, // Use eodExchange if available
|
||||
actionType: 'splits',
|
||||
country: symbol.Country
|
||||
}, {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ export async function scheduleFetchFundamentals(
|
|||
const etf = etfs[i];
|
||||
await this.scheduleOperation('fetch-single-fundamentals', {
|
||||
symbol: etf.Code,
|
||||
exchange: etf.Exchange,
|
||||
exchange: etf.eodExchange || etf.Exchange, // Use eodExchange if available
|
||||
country: etf.Country
|
||||
}, {
|
||||
attempts: 3,
|
||||
|
|
@ -96,7 +96,7 @@ export async function scheduleFetchFundamentals(
|
|||
// Convert to array of {symbol, exchange, country} objects
|
||||
const symbolBatch = batch.map(s => ({
|
||||
symbol: s.Code,
|
||||
exchange: s.Exchange,
|
||||
exchange: s.eodExchange || s.Exchange, // Use eodExchange if available
|
||||
country: s.Country
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ export async function scheduleIntradayCrawl(
|
|||
|
||||
await this.scheduleOperation('crawl-intraday', {
|
||||
symbol: symbol.Code,
|
||||
exchange: symbol.Exchange,
|
||||
exchange: symbol.eodExchange || symbol.Exchange, // Use eodExchange if available
|
||||
interval,
|
||||
country: symbol.Country
|
||||
}, {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export async function scheduleFetchPrices(
|
|||
|
||||
await this.scheduleOperation('fetch-prices', {
|
||||
symbol: symbol.Code,
|
||||
exchange: symbol.Exchange,
|
||||
exchange: symbol.eodExchange || symbol.Exchange, // Use eodExchange if available
|
||||
country: symbol.Country
|
||||
}, {
|
||||
attempts: 3,
|
||||
|
|
|
|||
|
|
@ -128,7 +128,8 @@ export async function fetchSymbols(
|
|||
// Add metadata to each symbol
|
||||
const symbolsWithMetadata = symbols.map(symbol => ({
|
||||
...symbol,
|
||||
Exchange: symbol.Exchange || exchangeCode, // Ensure Exchange is set
|
||||
Exchange: symbol.Exchange || exchangeCode, // Keep the original exchange (might be wrong)
|
||||
eodExchange: exchangeCode, // Store the correct exchange code used to fetch this symbol
|
||||
delisted: delisted,
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import type { DataIngestionServices } from '../../types';
|
|||
import { fetchCountries, spiderUrl } from './actions';
|
||||
|
||||
@Handler('te')
|
||||
// @Disabled()
|
||||
@Disabled()
|
||||
export class TeHandler extends BaseHandler<DataIngestionServices> {
|
||||
constructor(services: any) {
|
||||
super(services);
|
||||
|
|
@ -17,7 +17,7 @@ export class TeHandler extends BaseHandler<DataIngestionServices> {
|
|||
@ScheduledOperation('te-countries', '0 0 * * 0', {
|
||||
priority: 5,
|
||||
description: 'Fetch and update Trading Economics countries data',
|
||||
immediately: true,
|
||||
immediately: false,
|
||||
})
|
||||
@Disabled()
|
||||
fetchCountries = fetchCountries;
|
||||
|
|
@ -25,7 +25,7 @@ export class TeHandler extends BaseHandler<DataIngestionServices> {
|
|||
@ScheduledOperation('te-spider', '0 0 * * 0', {
|
||||
priority: 5,
|
||||
description: 'Fetch and update Trading Economics countries data',
|
||||
immediately: true,
|
||||
immediately: false,
|
||||
})
|
||||
spiderUrlSchedule = spiderUrl;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue