Reduce DB pool size, payment concurrency, and job attempts
This commit is contained in:
parent
a929d89fb3
commit
f55ea5b731
@ -16,7 +16,7 @@ import { Payment } from '../payments/entities/payment.entity';
|
||||
database: configService.get('database.database'),
|
||||
entities: [Payment],
|
||||
extra: {
|
||||
max: 10,
|
||||
max: 5,
|
||||
// connectionTimeoutMillis: 3000,
|
||||
},
|
||||
synchronize: false,
|
||||
|
||||
@ -8,7 +8,7 @@ import { Payment } from '../entities/payment.entity';
|
||||
import { Repository } from 'typeorm';
|
||||
import { CreatePaymentDto } from '../dto/create-payment.dto';
|
||||
|
||||
@Processor(PAYMENT_QUEUE, { concurrency: 10 })
|
||||
@Processor(PAYMENT_QUEUE, { concurrency: 5 })
|
||||
@Injectable()
|
||||
export class PaymentProcessor extends WorkerHost {
|
||||
private readonly logger = new Logger(PaymentProcessor.name);
|
||||
|
||||
@ -11,7 +11,7 @@ export class QueueService {
|
||||
async addPaymentJob(data: CreatePaymentDto): Promise<void> {
|
||||
await this.paymentQueue.add(PAYMENT_QUEUE, data, {
|
||||
jobId: data.correlationId,
|
||||
attempts: 100,
|
||||
attempts: 90,
|
||||
backoff: {
|
||||
type: 'exponential',
|
||||
delay: 100,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user