switched eod to new exchange way

This commit is contained in:
Boki 2025-07-09 12:09:18 -04:00
parent f4366f7289
commit 7a99d08d04
7 changed files with 11 additions and 12 deletions

View file

@ -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
}, {

View file

@ -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
}));

View file

@ -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
}, {

View file

@ -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,

View file

@ -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,
}));

View file

@ -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;
}

View file

@ -11,11 +11,9 @@ Data Ingestion
Servers
Proxmox
- move gitlab to router server
- set up monitoring solution
Truenas
- switch truenas to RAIDz2
- set up frigate with coral
- set up minio