gemcap-be-common 1.3.105 → 1.3.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -469,7 +469,7 @@ class LoanTransactionsService {
|
|
|
469
469
|
await recalcFloatedBalance();
|
|
470
470
|
}
|
|
471
471
|
async recalculateBalanceQueued(productId, transactionId) {
|
|
472
|
-
await this.mainQueueService.sendTaskToQueue({ productId, transactionId }, 'recalc#BALANCES');
|
|
472
|
+
await this.mainQueueService.sendTaskToQueue({ data: { productId, transactionId }, pattern: 'recalc#BALANCES' }, 'goat_legacy_queue');
|
|
473
473
|
}
|
|
474
474
|
async recalculateBalance(transactionId) {
|
|
475
475
|
const startTransaction = await LoanTransaction_model_1.LoanTransaction.findById(transactionId).lean();
|
|
@@ -535,7 +535,7 @@ export class LoanTransactionsService {
|
|
|
535
535
|
}
|
|
536
536
|
|
|
537
537
|
async recalculateBalanceQueued(productId: string, transactionId: string) {
|
|
538
|
-
await this.mainQueueService.sendTaskToQueue({ productId, transactionId }, 'recalc#BALANCES');
|
|
538
|
+
await this.mainQueueService.sendTaskToQueue({ data: { productId, transactionId }, pattern: 'recalc#BALANCES' }, 'goat_legacy_queue');
|
|
539
539
|
}
|
|
540
540
|
|
|
541
541
|
async recalculateBalance(transactionId: string) {
|
|
@@ -12,9 +12,8 @@ class MainQueueService {
|
|
|
12
12
|
const rabbitMQApi = NODE_ENV === 'development' ? 'localhost' : 'rabbitmq';
|
|
13
13
|
const connection = await amqplib_1.default.connect(`amqp://${rabbitMQApi}`, { heartbeat: 10 });
|
|
14
14
|
const channel = await connection.createChannel();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
channel.sendToQueue(queue, Buffer.from(JSON.stringify(task)));
|
|
15
|
+
await channel.assertQueue(queueName);
|
|
16
|
+
channel.sendToQueue(queueName, Buffer.from(JSON.stringify(task)));
|
|
18
17
|
await channel.close();
|
|
19
18
|
await connection.close();
|
|
20
19
|
console.log('new task is sent');
|
|
@@ -9,10 +9,9 @@ export class MainQueueService {
|
|
|
9
9
|
const rabbitMQApi = NODE_ENV === 'development' ? 'localhost' : 'rabbitmq';
|
|
10
10
|
const connection = await amqp.connect(`amqp://${rabbitMQApi}`, { heartbeat: 10 });
|
|
11
11
|
const channel = await connection.createChannel();
|
|
12
|
-
const queue = queueName;
|
|
13
12
|
|
|
14
|
-
await channel.assertQueue(
|
|
15
|
-
channel.sendToQueue(
|
|
13
|
+
await channel.assertQueue(queueName);
|
|
14
|
+
channel.sendToQueue(queueName, Buffer.from(JSON.stringify(task)));
|
|
16
15
|
|
|
17
16
|
await channel.close();
|
|
18
17
|
await connection.close();
|