simplified providers a bit
This commit is contained in:
parent
26eaaa6d61
commit
eca0396293
9 changed files with 48 additions and 209 deletions
|
|
@ -15,8 +15,7 @@ const getEvery24HourCron = (): string => {
|
|||
|
||||
export const proxyProvider: ProviderConfig = {
|
||||
name: 'proxy-provider',
|
||||
service: 'data-service',
|
||||
operations: { 'fetch-and-check': async (payload: { sources?: string[] }) => {
|
||||
operations: {'fetch-and-check': async (payload: { sources?: string[] }) => {
|
||||
const { proxyService } = await import('./proxy.tasks');
|
||||
const { queueManager } = await import('../services/queue.service');
|
||||
const { processItems } = await import('../utils/batch-helpers');
|
||||
|
|
@ -35,13 +34,11 @@ export const proxyProvider: ProviderConfig = {
|
|||
index,
|
||||
source: 'batch-processing'
|
||||
}),
|
||||
queueManager,
|
||||
{
|
||||
queueManager, {
|
||||
totalDelayMs: parseInt(process.env.PROXY_VALIDATION_HOURS || '4') * 60 * 60 * 1000,
|
||||
batchSize: parseInt(process.env.PROXY_BATCH_SIZE || '200'),
|
||||
useBatching: process.env.PROXY_DIRECT_MODE !== 'true',
|
||||
priority: 2,
|
||||
service: 'data-service',
|
||||
provider: 'proxy-provider',
|
||||
operation: 'check-proxy'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,6 @@ export async function queueProxyFetch(): Promise<string> {
|
|||
const { queueManager } = await import('../services/queue.service');
|
||||
const job = await queueManager.addJob({
|
||||
type: 'proxy-fetch',
|
||||
service: 'proxy',
|
||||
provider: 'proxy-service',
|
||||
operation: 'fetch-and-check',
|
||||
payload: {},
|
||||
|
|
@ -170,7 +169,6 @@ export async function queueProxyCheck(proxies: ProxyInfo[]): Promise<string> {
|
|||
const { queueManager } = await import('../services/queue.service');
|
||||
const job = await queueManager.addJob({
|
||||
type: 'proxy-check',
|
||||
service: 'proxy',
|
||||
provider: 'proxy-service',
|
||||
operation: 'check-specific',
|
||||
payload: { proxies },
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ const logger = getLogger('quotemedia-provider');
|
|||
|
||||
export const quotemediaProvider: ProviderConfig = {
|
||||
name: 'quotemedia',
|
||||
service: 'market-data',
|
||||
operations: { 'live-data': async (payload: { symbol: string; fields?: string[] }) => {
|
||||
logger.info('Fetching live data from QuoteMedia', { symbol: payload.symbol });
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ const logger = getLogger('yahoo-provider');
|
|||
|
||||
export const yahooProvider: ProviderConfig = {
|
||||
name: 'yahoo-finance',
|
||||
service: 'market-data',
|
||||
operations: {
|
||||
'live-data': async (payload: { symbol: string; modules?: string[] }) => {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue