@vasrefil/api-toolkit 1.7.6 → 1.7.7

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.
@@ -1,3 +1,3 @@
1
1
  import { Queue } from 'bullmq';
2
- export declare const EmailQueue: Queue<any, any, string, any, any, string>;
3
- export declare const InAppNotificationQueue: Queue<any, any, string, any, any, string>;
2
+ export declare const EmailQueue: () => Queue<any, any, string, any, any, string>;
3
+ export declare const InAppNotificationQueue: () => Queue<any, any, string, any, any, string>;
@@ -17,20 +17,22 @@ const backoff = {
17
17
  type: 'exponential',
18
18
  delay: 10000,
19
19
  };
20
- exports.EmailQueue = new bullmq_1.Queue(common_2.JOB.EMAIL, {
21
- connection,
22
- defaultJobOptions: {
20
+ const EmailQueue = () => {
21
+ const defaultJobOptions = {
23
22
  attempts,
24
23
  backoff,
25
24
  removeOnComplete
26
- },
27
- });
28
- exports.InAppNotificationQueue = new bullmq_1.Queue(common_2.JOB.IN_APP_NOTIFICATION, {
29
- connection,
30
- defaultJobOptions: {
25
+ };
26
+ return new bullmq_1.Queue(common_2.JOB.EMAIL, { connection, defaultJobOptions });
27
+ };
28
+ exports.EmailQueue = EmailQueue;
29
+ const InAppNotificationQueue = () => {
30
+ const defaultJobOptions = {
31
31
  attempts: 1,
32
32
  backoff,
33
33
  removeOnComplete,
34
34
  removeOnFail: removeOnComplete
35
- },
36
- });
35
+ };
36
+ return new bullmq_1.Queue(common_2.JOB.IN_APP_NOTIFICATION, { connection, defaultJobOptions });
37
+ };
38
+ exports.InAppNotificationQueue = InAppNotificationQueue;
@@ -7,7 +7,7 @@ class EmailUtil_ {
7
7
  constructor() {
8
8
  this.send_email = async (payload) => {
9
9
  try {
10
- queue_1.EmailQueue.add(payload.action_type, {
10
+ (0, queue_1.EmailQueue)().add(payload.action_type, {
11
11
  ...payload,
12
12
  });
13
13
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vasrefil/api-toolkit",
3
3
  "description": "This is Vasrefil API toolkit",
4
- "version": "1.7.6",
4
+ "version": "1.7.7",
5
5
  "author": "Sodiq Alabi",
6
6
  "main": "dist/public-api.js",
7
7
  "types": "dist/public-api.d.ts",