moved jobs to provider config
This commit is contained in:
parent
f9c2860ff4
commit
52c2f08db2
7 changed files with 183 additions and 76 deletions
|
|
@ -155,8 +155,7 @@ export const quotemediaProvider: ProviderConfig = {
|
|||
}));
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, 400 + Math.random() * 300));
|
||||
|
||||
return {
|
||||
return {
|
||||
symbol: payload.symbol,
|
||||
expiration: payload.expiration || new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString().split('T')[0],
|
||||
calls,
|
||||
|
|
@ -164,5 +163,32 @@ export const quotemediaProvider: ProviderConfig = {
|
|||
source: 'quotemedia'
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
scheduledJobs: [
|
||||
{
|
||||
type: 'quotemedia-premium-refresh',
|
||||
operation: 'batch-quotes',
|
||||
payload: { symbols: ['AAPL', 'GOOGL', 'MSFT'] },
|
||||
cronPattern: '*/2 * * * *', // Every 2 minutes
|
||||
priority: 7,
|
||||
description: 'Refresh premium quotes with detailed market data'
|
||||
},
|
||||
{
|
||||
type: 'quotemedia-options-update',
|
||||
operation: 'options-chain',
|
||||
payload: { symbol: 'SPY' },
|
||||
cronPattern: '*/10 * * * *', // Every 10 minutes
|
||||
priority: 5,
|
||||
description: 'Update options chain data for SPY ETF'
|
||||
},
|
||||
{
|
||||
type: 'quotemedia-profiles',
|
||||
operation: 'company-profile',
|
||||
payload: { symbol: 'AAPL' },
|
||||
cronPattern: '0 9 * * 1-5', // Weekdays at 9 AM
|
||||
priority: 3,
|
||||
description: 'Update company profile data'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue