@yellowpanther/shared 1.3.3 → 1.3.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yellowpanther/shared",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/index.js CHANGED
@@ -34,4 +34,13 @@ module.exports = {
34
34
  addEventPublishJob: require("./queue/eventPublishQueue").addEventPublishJob,
35
35
  addUserPointsJob: require("./queue/addUserPointsQueue").addUserPointsJob,
36
36
  addShopPublishJob: require("./queue/shopPublishQueue").addShopPublishJob,
37
+
38
+ jobTranslationQueue: require("./queue/jobTranslationQueue").jobTranslationQueue,
39
+ addJobTranslationJob: require("./queue/jobTranslationQueue").addJobTranslationJob,
40
+
41
+ shopTranslationQueue: require("./queue/shopTranslationQueue").shopTranslationQueue,
42
+ addShopTranslationJob: require("./queue/shopTranslationQueue").addShopTranslationJob,
43
+
44
+ tournamentTranslationQueue: require("./queue/tournamentTranslationQueue").tournamentTranslationQueue,
45
+ addTournamentTranslationJob: require("./queue/tournamentTranslationQueue").addTournamentTranslationJob
37
46
  };
@@ -0,0 +1,29 @@
1
+ const { Queue } = require('bullmq');
2
+ const redisClient = require('../redis/redisClient');
3
+
4
+ const jobTranslationQueue = new Queue('jobTranslationQueue', {
5
+ connection: redisClient,
6
+ defaultJobOptions: {
7
+ removeOnComplete: false,
8
+ removeOnFail: false,
9
+ attempts: 3,
10
+ backoff: {
11
+ type: 'exponential',
12
+ delay: 1000
13
+ }
14
+ }
15
+ });
16
+
17
+ /**
18
+ * Add a job translation job
19
+ * @param {Object} jobData
20
+ * @returns {Promise<void>}
21
+ */
22
+ async function addJobTranslationJob({ job_id, translation }) {
23
+ await jobTranslationQueue.add('translateJob', { job_id, translation });
24
+ }
25
+
26
+ module.exports = {
27
+ jobTranslationQueue,
28
+ addJobTranslationJob
29
+ };
@@ -0,0 +1,29 @@
1
+ const { Queue } = require('bullmq');
2
+ const redisClient = require('../redis/redisClient');
3
+
4
+ const shopTranslationQueue = new Queue('shopTranslationQueue', {
5
+ connection: redisClient,
6
+ defaultJobOptions: {
7
+ removeOnComplete: false,
8
+ removeOnFail: false,
9
+ attempts: 3,
10
+ backoff: {
11
+ type: 'exponential',
12
+ delay: 1000
13
+ }
14
+ }
15
+ });
16
+
17
+ /**
18
+ * Add a shop translation job
19
+ * @param {Object} jobData
20
+ * @returns {Promise<void>}
21
+ */
22
+ async function addShopTranslationJob({ shop_id, translation }) {
23
+ await shopTranslationQueue.add('translateShop', { shop_id, translation });
24
+ }
25
+
26
+ module.exports = {
27
+ shopTranslationQueue,
28
+ addShopTranslationJob
29
+ };
@@ -0,0 +1,29 @@
1
+ const { Queue } = require('bullmq');
2
+ const redisClient = require('../redis/redisClient');
3
+
4
+ const tournamentTranslationQueue = new Queue('tournamentTranslationQueue', {
5
+ connection: redisClient,
6
+ defaultJobOptions: {
7
+ removeOnComplete: false,
8
+ removeOnFail: false,
9
+ attempts: 3,
10
+ backoff: {
11
+ type: 'exponential',
12
+ delay: 1000
13
+ }
14
+ }
15
+ });
16
+
17
+ /**
18
+ * Add a tournament translation job
19
+ * @param {Object} jobData
20
+ * @returns {Promise<void>}
21
+ */
22
+ async function addTournamentTranslationJob({ tournament_id, translation }) {
23
+ await tournamentTranslationQueue.add('translateTournament', { tournament_id, translation });
24
+ }
25
+
26
+ module.exports = {
27
+ tournamentTranslationQueue,
28
+ addTournamentTranslationJob
29
+ };