lint issues
This commit is contained in:
parent
19dfda2392
commit
190b725149
7 changed files with 71 additions and 28 deletions
|
|
@ -11,6 +11,16 @@ import type {
|
|||
} from './types';
|
||||
import { getRedisConnection } from './utils';
|
||||
|
||||
// Logger interface for type safety
|
||||
interface Logger {
|
||||
info(message: string, meta?: Record<string, unknown>): void;
|
||||
error(message: string, meta?: Record<string, unknown>): void;
|
||||
warn(message: string, meta?: Record<string, unknown>): void;
|
||||
debug(message: string, meta?: Record<string, unknown>): void;
|
||||
trace(message: string, meta?: Record<string, unknown>): void;
|
||||
child?(name: string, context?: Record<string, unknown>): Logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* QueueManager provides unified queue and cache management
|
||||
* Main entry point for all queue operations with getQueue() method
|
||||
|
|
@ -24,9 +34,9 @@ export class QueueManager {
|
|||
private isShuttingDown = false;
|
||||
private shutdownPromise: Promise<void> | null = null;
|
||||
private config: QueueManagerConfig;
|
||||
private readonly logger: any;
|
||||
private readonly logger: Logger;
|
||||
|
||||
constructor(config: QueueManagerConfig, logger?: any) {
|
||||
constructor(config: QueueManagerConfig, logger?: Logger) {
|
||||
this.config = config;
|
||||
this.logger = logger || console;
|
||||
this.redisConnection = getRedisConnection(config.redis);
|
||||
|
|
@ -52,6 +62,8 @@ export class QueueManager {
|
|||
* @throws Error if not initialized - use initialize() first
|
||||
*/
|
||||
static getInstance(): QueueManager {
|
||||
// Deprecated warning - using console since we don't have a logger instance
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
'QueueManager.getInstance() is deprecated. Please use dependency injection instead.'
|
||||
);
|
||||
|
|
@ -67,10 +79,13 @@ export class QueueManager {
|
|||
* Must be called before getInstance()
|
||||
*/
|
||||
static initialize(config: QueueManagerConfig): QueueManager {
|
||||
// Deprecated warning - using console since we don't have a logger instance
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
'QueueManager.initialize() is deprecated. Please use dependency injection instead.'
|
||||
);
|
||||
if (QueueManager.instance) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('QueueManager already initialized, returning existing instance');
|
||||
return QueueManager.instance;
|
||||
}
|
||||
|
|
@ -84,6 +99,8 @@ export class QueueManager {
|
|||
* Convenience method that combines initialize and getInstance
|
||||
*/
|
||||
static getOrInitialize(config?: QueueManagerConfig): QueueManager {
|
||||
// Deprecated warning - using console since we don't have a logger instance
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
'QueueManager.getOrInitialize() is deprecated. Please use dependency injection instead.'
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue