work on qm and added disabled to operetions

This commit is contained in:
Boki 2025-06-29 09:15:11 -04:00
parent 2011c4c83f
commit 38bd15cad8
8 changed files with 67 additions and 181 deletions

View file

@ -125,7 +125,7 @@ export async function getPosts(this: CeoHandler, payload: any, _context: any): P
symbolData?.newestPostTimestamp || symbolData?.lastSpielTime || 0;
// Filter to only posts newer than what we've seen
const newPosts = posts.filter(p => p.timestamp > lastKnownNewestTimestamp);
const newPosts = posts.filter((p: any) => p.timestamp > lastKnownNewestTimestamp);
if (newPosts.length === 0) {
this.logger.info(`No new posts for ${ceoId}, all ${posts.length} posts already collected`);
@ -171,7 +171,7 @@ export async function getPosts(this: CeoHandler, payload: any, _context: any): P
this.logger.info(`Successfully processed channel ${ceoId}`);
return { ceoId, spielCount, timestamp };
} catch (error) {
} catch (error: any) {
this.logger.error(`Failed to process individual symbol ${symbol}`, {
error,
ceoId,

View file

@ -52,6 +52,10 @@ export class QMHandler extends BaseHandler<DataIngestionServices> {
/**
* SYMBOLS
*/
@Operation('search-symbols')
searchSymbols = searchSymbols;
@Disabled()
@ScheduledOperation('spider-symbols', '0 0 * * 0', {
priority: 9,
immediately: false,
@ -59,9 +63,6 @@ export class QMHandler extends BaseHandler<DataIngestionServices> {
})
spiderSymbol = spiderSymbol;
@Operation('search-symbols')
searchSymbols = searchSymbols;
/**
* SYMBOL INFO
*/

View file

@ -7,6 +7,7 @@ import { getRandomUserAgent } from "@stock-bot/utils";
// QM Session IDs for different endpoints
export const QM_SESSION_IDS = {
LOOKUP: 'dc8c9930437f65d30f6597768800957017bac203a0a50342932757c8dfa158d6', // lookup endpoint
PROFILES: '1e1d7cb1de1fd2fe52684abdea41a446919a5fe12776dfab88615ac1ce1ec2f6', // getProfiles
// '5ad521e05faf5778d567f6d0012ec34d6cdbaeb2462f41568f66558bc7b4ced9': [], //4488d072b
// cc1cbdaf040f76db8f4c94f7d156b9b9b716e1a7509ec9c74a48a47f6b6b9f87: [], //97ff00cf3 // getQuotes
// '74963ff42f1db2320d051762b5d3950ff9eab23f9d5c5b592551b4ca0441d086': [], //32ca24e394b // getSplitsBySymbol getBrokerRatingsBySymbol getDividendsBySymbol getEarningsSurprisesBySymbol getEarningsEventsBySymbol
@ -32,8 +33,8 @@ export const QM_CONFIG = {
// Session management settings
export const SESSION_CONFIG = {
MIN_SESSIONS: 50,
MAX_SESSIONS: 100,
MIN_SESSIONS: 10,
MAX_SESSIONS: 10,
MAX_FAILED_CALLS: 3,
SESSION_TIMEOUT: 5000, // 10 seconds
API_TIMEOUT: 30000, // 15 seconds

View file

@ -56,7 +56,7 @@ export class QMSessionManager {
/**
* Initialize with cache provider and logger
*/
initialize(cache?: CacheProvider, logger?: Logger): void {
initialize(cache: CacheProvider, logger: Logger): void {
if (cache) {
this.setCacheProvider(cache);
}