fixes up financials

This commit is contained in:
Boki 2025-06-30 08:30:55 -04:00
parent 88a5fa5da0
commit f78558224f
2 changed files with 5 additions and 25 deletions

View file

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

View file

@ -58,23 +58,3 @@ export function getQmHeaders(): Record<string, string> {
Referer: 'https://www.quotemedia.com/',
};
}
curl 'https://app.quotemedia.com/datatool/getFinancialsEnhancedBySymbol.json?currency=true&lang=en&latestfiscaldate=true&numberOfReports=300&pathName=%2Fdemo%2Fportal%2Fcompany-research.php&qmodTool=Financials&reportType=Q&symbol=AAPL&webmasterId=500' \
-H 'accept: */*' \
-H 'accept-language: en' \
-H 'cache-control: no-cache' \
-b 'JSESSIONID=4960DF4F7AFADB62E678C6128553FAA3' \
-H 'datatool-token: 0401d87a798899b5185fd0dae4d6829c3d1db7c15f44571637556a606b5a4474' \
-H 'origin: https://client.quotemedia.com' \
-H 'pragma: no-cache' \
-H 'priority: u=1, i' \
-H 'referer: https://client.quotemedia.com/' \
-H 'sec-ch-ua: "Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "Linux"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-site' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36' \
-o 'test.json'