fixes up financials
This commit is contained in:
parent
88a5fa5da0
commit
f78558224f
2 changed files with 5 additions and 25 deletions
|
|
@ -106,7 +106,7 @@ export async function updateFinancials(
|
|||
|
||||
// Update symbol to track last financials update
|
||||
const tracker = await getOperationTracker(this);
|
||||
await tracker.updateSymbolOperation(qmSearchCode, 'financials_update', {
|
||||
await tracker.updateSymbolOperation(qmSearchCode, `financials_${reportType === 'Q'? 'quarterly' : 'annual'}_update`, {
|
||||
status: 'success',
|
||||
lastRecordDate: new Date(),
|
||||
recordCount: reports.length
|
||||
|
|
@ -179,11 +179,11 @@ export async function scheduleFinancialsUpdates(
|
|||
|
||||
try {
|
||||
// Get symbols that need updating for both quarterly and annual
|
||||
const staleSymbolsQ = await tracker.getStaleSymbols('financials_update_quarterly', {
|
||||
const staleSymbolsQ = await tracker.getStaleSymbols('financials_quarterly_update', {
|
||||
minHoursSinceRun: forceUpdate ? 0 : 24 * 7, // Weekly by default
|
||||
limit
|
||||
});
|
||||
const staleSymbolsA = await tracker.getStaleSymbols('financials_update_annual', {
|
||||
const staleSymbolsA = await tracker.getStaleSymbols('financials_annual_update', {
|
||||
minHoursSinceRun: forceUpdate ? 0 : 24 * 7, // Weekly by default
|
||||
limit
|
||||
});
|
||||
|
|
@ -225,7 +225,7 @@ export async function scheduleFinancialsUpdates(
|
|||
lastRecordDate: doc.operations?.price_update?.lastRecordDate,
|
||||
}, {
|
||||
priority: 4,
|
||||
delay: queued * 200 // 1 second between jobs
|
||||
delay: queued // 1 second between jobs
|
||||
});
|
||||
|
||||
queued++;
|
||||
|
|
@ -246,7 +246,7 @@ export async function scheduleFinancialsUpdates(
|
|||
lastRecordDate: doc.operations?.price_update?.lastRecordDate,
|
||||
}, {
|
||||
priority: 4,
|
||||
delay: queued * 200 // 1 second between jobs
|
||||
delay: queued // 1 second between jobs
|
||||
});
|
||||
|
||||
queued++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue