joye-backend-utility 5.0.37 → 5.0.39
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/dist/redisClient.js +14 -2
- package/dist/schema/userReminder.js +24 -0
- package/package.json +1 -1
package/dist/redisClient.js
CHANGED
|
@@ -5,16 +5,28 @@ const redis_1 = require("redis");
|
|
|
5
5
|
class RedisClient {
|
|
6
6
|
static async getInstance() {
|
|
7
7
|
if (!RedisClient.instance) {
|
|
8
|
+
const cachePort = process.env.REDIS_CACHE_PORT;
|
|
8
9
|
const cacheHostName = process.env.REDIS_CACHE_HOST;
|
|
9
10
|
const cachePassword = process.env.REDIS_CACHE_PASSWORD;
|
|
10
11
|
RedisClient.instance = await (0, redis_1.createClient)({
|
|
11
12
|
// redis for TLS
|
|
12
|
-
url: `rediss://${cacheHostName}
|
|
13
|
+
url: `rediss://${cacheHostName}:${cachePort}`,
|
|
13
14
|
password: cachePassword,
|
|
14
15
|
})
|
|
15
|
-
.on('error', err =>
|
|
16
|
+
.on('error', err => {
|
|
17
|
+
console.log('Redis Client Error', err);
|
|
18
|
+
})
|
|
19
|
+
.on('connect', () => {
|
|
20
|
+
console.log('Connected to Redis');
|
|
21
|
+
})
|
|
22
|
+
.on('end', () => {
|
|
23
|
+
console.log('Connection to Redis end');
|
|
24
|
+
})
|
|
16
25
|
.connect();
|
|
17
26
|
}
|
|
27
|
+
if (!RedisClient.instance.isOpen) {
|
|
28
|
+
return await RedisClient.instance.connect();
|
|
29
|
+
}
|
|
18
30
|
return RedisClient.instance;
|
|
19
31
|
}
|
|
20
32
|
}
|
|
@@ -24,5 +24,29 @@ const UserReminder = new mongoose_1.Schema({
|
|
|
24
24
|
type: String,
|
|
25
25
|
required: true,
|
|
26
26
|
},
|
|
27
|
+
taskOneDate: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
taskTwoDate: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
taskThreeDate: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
taskOneTime: {
|
|
40
|
+
type: String,
|
|
41
|
+
required: true,
|
|
42
|
+
},
|
|
43
|
+
taskTwoTime: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: true,
|
|
46
|
+
},
|
|
47
|
+
taskThreeTime: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: true,
|
|
50
|
+
},
|
|
27
51
|
});
|
|
28
52
|
exports.UserReminderSchema = UserReminder;
|