not-node 6.2.23 → 6.2.24
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 +1 -1
- package/src/cluster/cluster.redis.js +3 -0
- package/src/cluster/index.js +7 -2
- package/src/common.js +7 -9
package/package.json
CHANGED
|
@@ -2,6 +2,9 @@ const notEnv = require("../env.js");
|
|
|
2
2
|
const notCommon = require("../common");
|
|
3
3
|
const { error } = require("not-log")(module, "ClusterRedis");
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Cluster event bus driver upon Redis events
|
|
7
|
+
*/
|
|
5
8
|
module.exports = class notClusterRedisProvider {
|
|
6
9
|
static #clientGetter = null;
|
|
7
10
|
static #clientName = "db.redis";
|
package/src/cluster/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
const { log } = require("not-log")(module, "notCluster");
|
|
2
2
|
const notClusterRedis = require("./cluster.redis.js");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Interface to event bus of cluster
|
|
6
|
+
*/
|
|
7
|
+
class notCluster {
|
|
5
8
|
static #provider = notClusterRedis;
|
|
6
9
|
|
|
7
10
|
static setProvider(newProvider) {
|
|
@@ -22,4 +25,6 @@ module.exports = class notCluster {
|
|
|
22
25
|
static emit() {
|
|
23
26
|
return this.#provider.emit(...arguments);
|
|
24
27
|
}
|
|
25
|
-
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = notCluster;
|
package/src/common.js
CHANGED
|
@@ -210,15 +210,13 @@ module.exports.tryFile = (filePath) => {
|
|
|
210
210
|
* @param {string} filePath full path to file
|
|
211
211
|
* @return {Promise<boolean>} true if path exists and it's a file
|
|
212
212
|
**/
|
|
213
|
-
module.exports.tryFileAsync = (filePath) => {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
});
|
|
213
|
+
module.exports.tryFileAsync = async (filePath) => {
|
|
214
|
+
try {
|
|
215
|
+
const stat = await fs.promises.lstat(filePath);
|
|
216
|
+
return stat && stat.isFile();
|
|
217
|
+
} catch (e) {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
222
220
|
};
|
|
223
221
|
|
|
224
222
|
/**
|