lint issues
This commit is contained in:
parent
19dfda2392
commit
190b725149
7 changed files with 71 additions and 28 deletions
|
|
@ -51,14 +51,12 @@ describe('QueueManager', () => {
|
|||
describe('Basic Operations', () => {
|
||||
test('should initialize queue manager', async () => {
|
||||
queueManager = new QueueManager({
|
||||
queueName: 'test-queue',
|
||||
redis: redisConfig,
|
||||
workers: 1,
|
||||
concurrency: 5,
|
||||
});
|
||||
|
||||
await queueManager.initialize();
|
||||
expect(queueManager.queueName).toBe('test-queue');
|
||||
// No need to initialize anymore - constructor handles everything
|
||||
// QueueManager now manages multiple queues, not just one
|
||||
expect(queueManager).toBeDefined();
|
||||
});
|
||||
|
||||
test('should add and process a job', async () => {
|
||||
|
|
@ -73,15 +71,17 @@ describe('QueueManager', () => {
|
|||
});
|
||||
|
||||
queueManager = new QueueManager({
|
||||
queueName: 'test-queue',
|
||||
redis: redisConfig,
|
||||
});
|
||||
|
||||
// No need to initialize anymore - constructor handles everything
|
||||
// Get or create a queue
|
||||
const queue = queueManager.getQueue('test-queue', {
|
||||
workers: 1,
|
||||
});
|
||||
|
||||
await queueManager.initialize();
|
||||
|
||||
// Add job
|
||||
const job = await queueManager.add('test-job', {
|
||||
const job = await queue.add('test-job', {
|
||||
handler: 'test-handler',
|
||||
operation: 'test-operation',
|
||||
payload: { message: 'Hello, Queue!' },
|
||||
|
|
@ -102,7 +102,7 @@ describe('QueueManager', () => {
|
|||
workers: 1,
|
||||
});
|
||||
|
||||
await queueManager.initialize();
|
||||
// No need to initialize anymore - constructor handles everything
|
||||
|
||||
const job = await queueManager.add('test-job', {
|
||||
handler: 'non-existent',
|
||||
|
|
@ -134,7 +134,7 @@ describe('QueueManager', () => {
|
|||
concurrency: 5,
|
||||
});
|
||||
|
||||
await queueManager.initialize();
|
||||
// No need to initialize anymore - constructor handles everything
|
||||
|
||||
const jobs = await queueManager.addBulk([
|
||||
{
|
||||
|
|
@ -166,7 +166,7 @@ describe('QueueManager', () => {
|
|||
workers: 0, // No workers, jobs will stay in waiting
|
||||
});
|
||||
|
||||
await queueManager.initialize();
|
||||
// No need to initialize anymore - constructor handles everything
|
||||
|
||||
// Add some jobs
|
||||
await queueManager.add('job1', {
|
||||
|
|
@ -205,7 +205,7 @@ describe('QueueManager', () => {
|
|||
workers: 1,
|
||||
});
|
||||
|
||||
await queueManager.initialize();
|
||||
// No need to initialize anymore - constructor handles everything
|
||||
|
||||
// Pause queue
|
||||
await queueManager.pause();
|
||||
|
|
@ -260,7 +260,7 @@ describe('QueueManager', () => {
|
|||
enableScheduledJobs: true,
|
||||
});
|
||||
|
||||
await queueManager.initialize();
|
||||
// No need to initialize anymore - constructor handles everything
|
||||
|
||||
// Wait for scheduled job to execute
|
||||
await new Promise(resolve => setTimeout(resolve, 2500));
|
||||
|
|
@ -296,7 +296,7 @@ describe('QueueManager', () => {
|
|||
},
|
||||
});
|
||||
|
||||
await queueManager.initialize();
|
||||
// No need to initialize anymore - constructor handles everything
|
||||
|
||||
const job = await queueManager.add('retry-job', {
|
||||
handler: 'retry-handler',
|
||||
|
|
@ -341,7 +341,7 @@ describe('QueueManager', () => {
|
|||
workers: 2,
|
||||
});
|
||||
|
||||
await queueManager.initialize();
|
||||
// No need to initialize anymore - constructor handles everything
|
||||
|
||||
// Add jobs for different handlers
|
||||
await queueManager.addBulk([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue