fixed all lint errors
This commit is contained in:
parent
519d24722e
commit
26d9b9ab3f
23 changed files with 63 additions and 43 deletions
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import {
|
||||
BaseHandler,
|
||||
Disabled,
|
||||
Handler,
|
||||
Operation,
|
||||
ScheduledOperation,
|
||||
|
|
@ -13,6 +14,7 @@ import {
|
|||
} from '@stock-bot/handlers';
|
||||
|
||||
@Handler('example')
|
||||
@Disabled()
|
||||
export class ExampleHandler extends BaseHandler {
|
||||
constructor(services: IServiceContainer) {
|
||||
super(services);
|
||||
|
|
@ -86,7 +88,7 @@ export class ExampleHandler extends BaseHandler {
|
|||
* Complex operation that still uses action file
|
||||
*/
|
||||
@Operation('process-batch')
|
||||
async processBatch(input: any, context: ExecutionContext): Promise<unknown> {
|
||||
async processBatch(input: any, _context: ExecutionContext): Promise<unknown> {
|
||||
// For complex operations, still use action files
|
||||
const { processBatch } = await import('./actions/batch.action');
|
||||
return processBatch(this, input);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Proxy Check Operations - Checking proxy functionality
|
||||
*/
|
||||
import { OperationContext } from '@stock-bot/di';
|
||||
import type { OperationContext } from '@stock-bot/di';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import type { ProxyInfo } from '@stock-bot/proxy';
|
||||
import { fetch } from '@stock-bot/utils';
|
||||
|
|
@ -13,7 +13,7 @@ import { PROXY_CONFIG } from '../shared/config';
|
|||
export async function checkProxy(proxy: ProxyInfo): Promise<ProxyInfo> {
|
||||
const ctx = {
|
||||
logger: getLogger('proxy-check'),
|
||||
resolve: <T>(_name: string) => {
|
||||
resolve: (_name: string) => {
|
||||
throw new Error(`Service container not available for proxy operations`);
|
||||
},
|
||||
} as any;
|
||||
|
|
@ -99,7 +99,7 @@ async function updateProxyInCache(
|
|||
isWorking: boolean,
|
||||
ctx: OperationContext
|
||||
): Promise<void> {
|
||||
const _cacheKey = `${PROXY_CONFIG.CACHE_KEY}:${proxy.protocol}://${proxy.host}:${proxy.port}`;
|
||||
// const _cacheKey = `${PROXY_CONFIG.CACHE_KEY}:${proxy.protocol}://${proxy.host}:${proxy.port}`;
|
||||
|
||||
try {
|
||||
// For now, skip cache operations without service container
|
||||
|
|
@ -147,7 +147,7 @@ async function updateProxyInCache(
|
|||
updated.successRate = updated.total > 0 ? (updated.working / updated.total) * 100 : 0;
|
||||
|
||||
// Save to cache: reset TTL for working proxies, keep existing TTL for failed ones
|
||||
const _cacheOptions = isWorking ? { ttl: PROXY_CONFIG.CACHE_TTL } : undefined;
|
||||
// const _cacheOptions = isWorking ? { ttl: PROXY_CONFIG.CACHE_TTL } : undefined;
|
||||
// Skip cache operations without service container
|
||||
// TODO: Pass service container to operations
|
||||
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@ export async function createSingleSession(
|
|||
handler: BaseHandler,
|
||||
input: any
|
||||
): Promise<{ sessionId: string; status: string; sessionType: string }> {
|
||||
const { sessionId, sessionType } = input || {};
|
||||
const sessionManager = QMSessionManager.getInstance();
|
||||
const { sessionId: _sessionId, sessionType } = input || {};
|
||||
const _sessionManager = QMSessionManager.getInstance();
|
||||
|
||||
// Get proxy from proxy service
|
||||
const proxyString = handler.proxy.getProxy();
|
||||
const _proxyString = handler.proxy.getProxy();
|
||||
|
||||
// const session = {
|
||||
// proxy: proxyString || 'http://proxy:8080',
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ const app = new ServiceApplication(
|
|||
},
|
||||
{
|
||||
// Lifecycle hooks if needed
|
||||
onStarted: (port) => {
|
||||
onStarted: (_port) => {
|
||||
const logger = getLogger('data-ingestion');
|
||||
logger.info('Data ingestion service startup initiated with ServiceApplication framework');
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue