redis-memory-server 0.6.0 → 0.7.0
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/LICENSE +21 -0
- package/lib/RedisMemoryServer.js +126 -212
- package/lib/RedisMemoryServer.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +5 -5
- package/lib/types.d.ts.map +1 -1
- package/lib/util/RedisBinary.js +123 -205
- package/lib/util/RedisBinary.js.map +1 -1
- package/lib/util/RedisBinaryDownload.d.ts +1 -1
- package/lib/util/RedisBinaryDownload.d.ts.map +1 -1
- package/lib/util/RedisBinaryDownload.js +201 -333
- package/lib/util/RedisBinaryDownload.js.map +1 -1
- package/lib/util/RedisBinaryDownloadUrl.js +32 -71
- package/lib/util/RedisBinaryDownloadUrl.js.map +1 -1
- package/lib/util/RedisInstance.d.ts +1 -0
- package/lib/util/RedisInstance.d.ts.map +1 -1
- package/lib/util/RedisInstance.js +126 -202
- package/lib/util/RedisInstance.js.map +1 -1
- package/lib/util/resolve-config.js +20 -22
- package/lib/util/resolve-config.js.map +1 -1
- package/package.json +43 -48
- package/scripts/postinstall.js +1 -1
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -19,56 +8,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
9
|
});
|
|
21
10
|
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
13
|
};
|
|
52
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (semver_1.lt(process.version, '10.15.0')) {
|
|
15
|
+
const cross_spawn_1 = __importDefault(require("cross-spawn"));
|
|
16
|
+
const path_1 = __importDefault(require("path"));
|
|
17
|
+
const RedisBinary_1 = __importDefault(require("./RedisBinary"));
|
|
18
|
+
const debug_1 = __importDefault(require("debug"));
|
|
19
|
+
const db_util_1 = require("./db_util");
|
|
20
|
+
const semver_1 = require("semver");
|
|
21
|
+
if ((0, semver_1.lt)(process.version, '10.15.0')) {
|
|
60
22
|
console.warn('Using NodeJS below 10.15.0');
|
|
61
23
|
}
|
|
62
|
-
|
|
24
|
+
const log = (0, debug_1.default)('RedisMS:RedisInstance');
|
|
63
25
|
/**
|
|
64
26
|
* Redis Instance Handler Class
|
|
65
27
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
28
|
+
class RedisInstance {
|
|
29
|
+
constructor(opts) {
|
|
68
30
|
var _a;
|
|
69
31
|
this.isInstanceReady = false;
|
|
70
|
-
this.instanceReady =
|
|
71
|
-
this.instanceFailed =
|
|
32
|
+
this.instanceReady = () => { };
|
|
33
|
+
this.instanceFailed = () => { };
|
|
72
34
|
this.opts = opts;
|
|
73
35
|
this.childProcess = null;
|
|
74
36
|
this.killerProcess = null;
|
|
@@ -80,34 +42,31 @@ var RedisInstance = /** @class */ (function () {
|
|
|
80
42
|
}
|
|
81
43
|
if (debug_1.default.enabled('RedisMS:RedisInstance')) {
|
|
82
44
|
// add instance's port to debug output
|
|
83
|
-
|
|
84
|
-
this.debug =
|
|
85
|
-
log(
|
|
45
|
+
const port = (_a = this.opts.instance) === null || _a === void 0 ? void 0 : _a.port;
|
|
46
|
+
this.debug = (msg) => {
|
|
47
|
+
log(`Redis[${port}]: ${msg}`);
|
|
86
48
|
};
|
|
87
49
|
}
|
|
88
50
|
else {
|
|
89
|
-
this.debug =
|
|
51
|
+
this.debug = () => { };
|
|
90
52
|
}
|
|
91
53
|
}
|
|
92
54
|
/**
|
|
93
55
|
* Create an new instance an call method "run"
|
|
94
56
|
* @param opts Options passed to the new instance
|
|
95
57
|
*/
|
|
96
|
-
|
|
97
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
-
|
|
99
|
-
return
|
|
100
|
-
instance = new this(opts);
|
|
101
|
-
return [2 /*return*/, instance.run()];
|
|
102
|
-
});
|
|
58
|
+
static run(opts) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const instance = new this(opts);
|
|
61
|
+
return instance.run();
|
|
103
62
|
});
|
|
104
|
-
}
|
|
63
|
+
}
|
|
105
64
|
/**
|
|
106
65
|
* Create an array of arguments for the redis-server instance
|
|
107
66
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
67
|
+
prepareCommandArgs() {
|
|
68
|
+
const { ip, port, args } = this.opts.instance;
|
|
69
|
+
const result = [];
|
|
111
70
|
result.push('--save', ''); // disable RDB snapshotting
|
|
112
71
|
result.push('--appendonly', 'no'); // disable AOF
|
|
113
72
|
result.push('--bind', ip || '127.0.0.1');
|
|
@@ -115,46 +74,38 @@ var RedisInstance = /** @class */ (function () {
|
|
|
115
74
|
result.push('--port', port.toString());
|
|
116
75
|
}
|
|
117
76
|
return result.concat(args !== null && args !== void 0 ? args : []);
|
|
118
|
-
}
|
|
77
|
+
}
|
|
119
78
|
/**
|
|
120
79
|
* Create the redis-server process
|
|
121
80
|
*/
|
|
122
|
-
|
|
123
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (_this.killerProcess) {
|
|
138
|
-
_this.killerProcess.kill();
|
|
139
|
-
}
|
|
140
|
-
reject(err);
|
|
141
|
-
};
|
|
142
|
-
});
|
|
143
|
-
return [4 /*yield*/, RedisBinary_1.default.getPath(this.opts.binary)];
|
|
144
|
-
case 1:
|
|
145
|
-
redisBin = _a.sent();
|
|
146
|
-
this.childProcess = this._launchRedisServer(redisBin);
|
|
147
|
-
this.killerProcess = this._launchKiller(process.pid, this.childProcess.pid);
|
|
148
|
-
return [4 /*yield*/, launch];
|
|
149
|
-
case 2:
|
|
150
|
-
_a.sent();
|
|
151
|
-
return [2 /*return*/, this];
|
|
152
|
-
}
|
|
81
|
+
run() {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const launch = new Promise((resolve, reject) => {
|
|
84
|
+
this.instanceReady = () => {
|
|
85
|
+
this.isInstanceReady = true;
|
|
86
|
+
this.debug('RedisInstance: Instance is ready!');
|
|
87
|
+
resolve(Object.assign({}, this.childProcess));
|
|
88
|
+
};
|
|
89
|
+
this.instanceFailed = (err) => {
|
|
90
|
+
this.debug(`RedisInstance: Instance has failed: ${err.toString()}`);
|
|
91
|
+
if (this.killerProcess) {
|
|
92
|
+
this.killerProcess.kill();
|
|
93
|
+
}
|
|
94
|
+
reject(err);
|
|
95
|
+
};
|
|
153
96
|
});
|
|
97
|
+
const redisBin = yield RedisBinary_1.default.getPath(this.opts.binary);
|
|
98
|
+
this.childProcess = this._launchRedisServer(redisBin);
|
|
99
|
+
if (this.childProcess.pid) {
|
|
100
|
+
this.killerProcess = this._launchKiller(process.pid, this.childProcess.pid);
|
|
101
|
+
}
|
|
102
|
+
yield launch;
|
|
103
|
+
return this;
|
|
154
104
|
});
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
105
|
+
}
|
|
106
|
+
kill() {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
this.debug('Called RedisInstance.kill():');
|
|
158
109
|
/**
|
|
159
110
|
* Function to De-Duplicate Code
|
|
160
111
|
* @param _process The Process to kill
|
|
@@ -162,165 +113,139 @@ var RedisInstance = /** @class */ (function () {
|
|
|
162
113
|
* @param debugfn the debug function
|
|
163
114
|
*/
|
|
164
115
|
function kill_internal(_process, name, debugfn) {
|
|
165
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
resolve(null);
|
|
192
|
-
});
|
|
193
|
-
debugfn("- " + name + ": send \"SIGINT\"");
|
|
194
|
-
_process.kill('SIGINT');
|
|
195
|
-
})];
|
|
196
|
-
case 1:
|
|
197
|
-
_a.sent();
|
|
198
|
-
return [2 /*return*/];
|
|
199
|
-
}
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
if (!(0, db_util_1.isAlive)(_process.pid)) {
|
|
118
|
+
debugfn('kill_internal given process PID is not alive anymore');
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const timeoutTime = 1000 * 10;
|
|
122
|
+
yield new Promise((resolve, reject) => {
|
|
123
|
+
let timeout = setTimeout(() => {
|
|
124
|
+
debugfn('kill_internal timeout triggered, trying SIGKILL');
|
|
125
|
+
if (!debug_1.default.enabled('RedisMS:RedisInstance')) {
|
|
126
|
+
console.warn('An Process didnt exit with signal "SIGINT" within 10 seconds, using "SIGKILL"!\n' +
|
|
127
|
+
'Enable debug logs for more information');
|
|
128
|
+
}
|
|
129
|
+
_process.kill('SIGKILL');
|
|
130
|
+
timeout = setTimeout(() => {
|
|
131
|
+
debugfn('kill_internal timeout triggered again, rejecting');
|
|
132
|
+
reject(new Error('Process didnt exit, enable debug for more information.'));
|
|
133
|
+
}, timeoutTime);
|
|
134
|
+
}, timeoutTime);
|
|
135
|
+
_process.once(`exit`, (code, signal) => {
|
|
136
|
+
debugfn(`- ${name}: got exit signal, Code: ${code}, Signal: ${signal}`);
|
|
137
|
+
clearTimeout(timeout);
|
|
138
|
+
resolve(null);
|
|
139
|
+
});
|
|
140
|
+
debugfn(`- ${name}: send "SIGINT"`);
|
|
141
|
+
_process.kill('SIGINT');
|
|
200
142
|
});
|
|
201
143
|
});
|
|
202
144
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return [4 /*yield*/, kill_internal(this.killerProcess, 'killerProcess', this.debug)];
|
|
218
|
-
case 4:
|
|
219
|
-
_a.sent();
|
|
220
|
-
return [3 /*break*/, 6];
|
|
221
|
-
case 5:
|
|
222
|
-
this.debug('- killerProcess: nothing to shutdown, skipping.');
|
|
223
|
-
_a.label = 6;
|
|
224
|
-
case 6:
|
|
225
|
-
this.debug('Instance Finished Shutdown');
|
|
226
|
-
return [2 /*return*/, this];
|
|
227
|
-
}
|
|
228
|
-
});
|
|
145
|
+
if (!(0, db_util_1.isNullOrUndefined)(this.childProcess)) {
|
|
146
|
+
yield kill_internal(this.childProcess, 'childProcess', this.debug);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
this.debug('- childProcess: nothing to shutdown, skipping.');
|
|
150
|
+
}
|
|
151
|
+
if (!(0, db_util_1.isNullOrUndefined)(this.killerProcess)) {
|
|
152
|
+
yield kill_internal(this.killerProcess, 'killerProcess', this.debug);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
this.debug('- killerProcess: nothing to shutdown, skipping.');
|
|
156
|
+
}
|
|
157
|
+
this.debug('Instance Finished Shutdown');
|
|
158
|
+
return this;
|
|
229
159
|
});
|
|
230
|
-
}
|
|
160
|
+
}
|
|
231
161
|
/**
|
|
232
162
|
* Get the PID of the redis-server instance
|
|
233
163
|
*/
|
|
234
|
-
|
|
164
|
+
getPid() {
|
|
235
165
|
var _a;
|
|
236
166
|
return (_a = this.childProcess) === null || _a === void 0 ? void 0 : _a.pid;
|
|
237
|
-
}
|
|
167
|
+
}
|
|
238
168
|
/**
|
|
239
169
|
* Actually launch redis-server
|
|
240
170
|
* @param redisBin The binary to run
|
|
241
171
|
*/
|
|
242
|
-
|
|
172
|
+
_launchRedisServer(redisBin) {
|
|
243
173
|
var _a, _b, _c;
|
|
244
|
-
|
|
174
|
+
const spawnOpts = (_a = this.opts.spawn) !== null && _a !== void 0 ? _a : {};
|
|
245
175
|
if (!spawnOpts.stdio) {
|
|
246
176
|
spawnOpts.stdio = 'pipe';
|
|
247
177
|
}
|
|
248
|
-
|
|
178
|
+
const childProcess = (0, cross_spawn_1.default)(redisBin, this.prepareCommandArgs(), spawnOpts);
|
|
249
179
|
(_b = childProcess.stderr) === null || _b === void 0 ? void 0 : _b.on('data', this.stderrHandler.bind(this));
|
|
250
180
|
(_c = childProcess.stdout) === null || _c === void 0 ? void 0 : _c.on('data', this.stdoutHandler.bind(this));
|
|
251
181
|
childProcess.on('close', this.closeHandler.bind(this));
|
|
252
182
|
childProcess.on('error', this.errorHandler.bind(this));
|
|
253
|
-
if (db_util_1.isNullOrUndefined(childProcess.pid)) {
|
|
183
|
+
if ((0, db_util_1.isNullOrUndefined)(childProcess.pid)) {
|
|
254
184
|
throw new Error('Spawned Redis Instance PID is undefined');
|
|
255
185
|
}
|
|
256
186
|
return childProcess;
|
|
257
|
-
}
|
|
187
|
+
}
|
|
258
188
|
/**
|
|
259
189
|
* Spawn an child to kill the parent and the redis-server instance if both are Dead
|
|
260
190
|
* @param parentPid Parent to kill
|
|
261
191
|
* @param childPid redis-server process to kill
|
|
262
192
|
*/
|
|
263
|
-
|
|
264
|
-
var _this = this;
|
|
193
|
+
_launchKiller(parentPid, childPid) {
|
|
265
194
|
var _a, _b, _c;
|
|
266
|
-
this.debug(
|
|
195
|
+
this.debug(`Called RedisInstance._launchKiller(parent: ${parentPid}, child: ${childPid}):`);
|
|
267
196
|
// spawn process which kills itself and redis process if current process is dead
|
|
268
|
-
|
|
197
|
+
const killer = (0, cross_spawn_1.default)((_a = process.env['NODE']) !== null && _a !== void 0 ? _a : process.argv[0], // try Environment variable "NODE" before using argv[0]
|
|
269
198
|
[
|
|
270
199
|
path_1.default.resolve(__dirname, '../../scripts/redis_killer.js'),
|
|
271
200
|
parentPid.toString(),
|
|
272
201
|
childPid.toString(),
|
|
273
202
|
], { stdio: 'pipe' });
|
|
274
|
-
(_b = killer.stdout) === null || _b === void 0 ? void 0 : _b.on('data',
|
|
275
|
-
|
|
203
|
+
(_b = killer.stdout) === null || _b === void 0 ? void 0 : _b.on('data', (data) => {
|
|
204
|
+
this.debug(`[RedisKiller]: ${data}`);
|
|
276
205
|
});
|
|
277
|
-
(_c = killer.stderr) === null || _c === void 0 ? void 0 : _c.on('data',
|
|
278
|
-
|
|
206
|
+
(_c = killer.stderr) === null || _c === void 0 ? void 0 : _c.on('data', (data) => {
|
|
207
|
+
this.debug(`[RedisKiller]: ${data}`);
|
|
279
208
|
});
|
|
280
|
-
['exit', 'message', 'disconnect', 'error'].forEach(
|
|
281
|
-
killer.on(type,
|
|
282
|
-
|
|
283
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
284
|
-
args[_i] = arguments[_i];
|
|
285
|
-
}
|
|
286
|
-
_this.debug("[RedisKiller]: " + type + " - " + JSON.stringify(args));
|
|
209
|
+
['exit', 'message', 'disconnect', 'error'].forEach((type) => {
|
|
210
|
+
killer.on(type, (...args) => {
|
|
211
|
+
this.debug(`[RedisKiller]: ${type} - ${JSON.stringify(args)}`);
|
|
287
212
|
});
|
|
288
213
|
});
|
|
289
214
|
return killer;
|
|
290
|
-
}
|
|
291
|
-
|
|
215
|
+
}
|
|
216
|
+
errorHandler(err) {
|
|
292
217
|
this.instanceFailed(err);
|
|
293
|
-
}
|
|
218
|
+
}
|
|
294
219
|
/**
|
|
295
220
|
* Write the CLOSE event to the debug function
|
|
296
221
|
* @param code The Exit code
|
|
297
222
|
*/
|
|
298
|
-
|
|
223
|
+
closeHandler(code) {
|
|
299
224
|
if (code != 0) {
|
|
300
225
|
this.debug('redis-server instance closed with an non-0 code!');
|
|
301
226
|
}
|
|
302
|
-
this.debug(
|
|
303
|
-
this.instanceFailed(
|
|
304
|
-
}
|
|
227
|
+
this.debug(`CLOSE: ${code}`);
|
|
228
|
+
this.instanceFailed(`redis-server instance closed with code "${code}"`);
|
|
229
|
+
}
|
|
305
230
|
/**
|
|
306
231
|
* Write STDERR to debug function
|
|
307
232
|
* @param message The STDERR line to write
|
|
308
233
|
*/
|
|
309
|
-
|
|
310
|
-
this.debug(
|
|
311
|
-
}
|
|
234
|
+
stderrHandler(message) {
|
|
235
|
+
this.debug(`STDERR: ${message.toString()}`);
|
|
236
|
+
}
|
|
312
237
|
/**
|
|
313
238
|
* Write STDOUT to debug function AND instanceReady/instanceFailed if inputs match
|
|
314
239
|
* @param message The STDOUT line to write/parse
|
|
315
240
|
*/
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
this.debug(
|
|
241
|
+
stdoutHandler(message) {
|
|
242
|
+
const line = message.toString();
|
|
243
|
+
this.debug(`STDOUT: ${line}`);
|
|
319
244
|
if (/Ready to accept connections/i.test(line)) {
|
|
320
245
|
this.instanceReady();
|
|
321
246
|
}
|
|
322
247
|
else if (/Address already in use/i.test(line)) {
|
|
323
|
-
this.instanceFailed(
|
|
248
|
+
this.instanceFailed(`Port ${this.opts.instance.port} already in use`);
|
|
324
249
|
}
|
|
325
250
|
else if (/redis-server instance already running/i.test(line)) {
|
|
326
251
|
this.instanceFailed('redis-server already running');
|
|
@@ -337,9 +262,8 @@ var RedisInstance = /** @class */ (function () {
|
|
|
337
262
|
else if (/\*\*\*aborting after/i.test(line)) {
|
|
338
263
|
this.instanceFailed('redis-server internal error');
|
|
339
264
|
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}());
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
RedisInstance.childProcessList = [];
|
|
344
268
|
exports.default = RedisInstance;
|
|
345
269
|
//# sourceMappingURL=RedisInstance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisInstance.js","sourceRoot":"","sources":["../../src/util/RedisInstance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RedisInstance.js","sourceRoot":"","sources":["../../src/util/RedisInstance.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,8DAAoD;AACpD,gDAAwB;AACxB,gEAAwC;AAGxC,kDAA0B;AAC1B,uCAAuD;AACvD,mCAA4B;AAE5B,IAAI,IAAA,WAAE,EAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;IAClC,OAAO,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;CAC5C;AAED,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,uBAAuB,CAAC,CAAC;AAiB3C;;GAEG;AACH,MAAqB,aAAa;IAWhC,YAAY,IAAoB;;QAJhC,oBAAe,GAAY,KAAK,CAAC;QACjC,kBAAa,GAAsB,GAAG,EAAE,GAAE,CAAC,CAAC;QAC5C,mBAAc,GAAsB,GAAG,EAAE,GAAE,CAAC,CAAC;QAG3C,IAAI,CAAC,IAAI,GAAG,IA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AAQ,CAAC,IAAI,iBAAiB,CAAC,CAAC;SACvE;aAAM,IAAI,wCAAwC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC9D,IAAI,CAAC,cAAc,CAAC,8BAA8B,CAAC,CAAC;SACrD;aAAM,IAAI,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC1C,IAAI,CAAC,cAAc,CAAC,gCAAgC,CAAC,CAAC;SACvD;aAAM,IAAI,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAChD,iEAAiE;YACjE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB,IAAI,CAAC,cAAc,CAAC,4BAA4B,CAAC,CAAC;aACnD;SACF;aAAM,IAAI,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC7C,IAAI,CAAC,cAAc,CAAC,6BAA6B,CAAC,CAAC;SACpD;IACH,CAAC;;AAlQM,8BAAgB,GAAmB,EAAE,AAArB,CAAsB;kBAD1B,aAAa"}
|
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.envToBool = exports.findPackageJson = exports.setDefaultValue = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
const camelcase_1 = __importDefault(require("camelcase"));
|
|
8
|
+
const find_package_json_1 = __importDefault(require("find-package-json"));
|
|
9
|
+
const debug_1 = __importDefault(require("debug"));
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const lodash_defaultsdeep_1 = __importDefault(require("lodash.defaultsdeep"));
|
|
12
|
+
const log = (0, debug_1.default)('RedisMS:ResolveConfig');
|
|
13
|
+
const ENV_CONFIG_PREFIX = 'REDISMS_';
|
|
14
|
+
const defaultValues = new Map();
|
|
15
15
|
/**
|
|
16
16
|
* Set an Default value for an specific key
|
|
17
17
|
* Mostly only used internally (for the "global-x.x" packages)
|
|
@@ -22,30 +22,29 @@ function setDefaultValue(key, value) {
|
|
|
22
22
|
defaultValues.set(key, value);
|
|
23
23
|
}
|
|
24
24
|
exports.setDefaultValue = setDefaultValue;
|
|
25
|
-
|
|
25
|
+
let packageJsonConfig = {};
|
|
26
26
|
/**
|
|
27
27
|
* Traverse up the hierarchy and combine all package.json files
|
|
28
28
|
* @param directory Set an custom directory to search the config in (default: process.cwd())
|
|
29
29
|
*/
|
|
30
30
|
function findPackageJson(directory) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const _packageJsonConfig = {};
|
|
32
|
+
const finderIterator = (0, find_package_json_1.default)(directory || process.cwd());
|
|
33
|
+
let foundPackageJson;
|
|
34
34
|
while ((foundPackageJson = finderIterator.next())) {
|
|
35
35
|
if (foundPackageJson.done) {
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
log(
|
|
40
|
-
|
|
38
|
+
const { value, filename } = foundPackageJson;
|
|
39
|
+
log(`Found package.json at "${filename}"`);
|
|
40
|
+
const ourConfig = (value === null || value === void 0 ? void 0 : value.redisMemoryServer) || {};
|
|
41
41
|
// resolve relative paths
|
|
42
|
-
for (
|
|
43
|
-
var relativePathProp = _a[_i];
|
|
42
|
+
for (const relativePathProp of ['downloadDir', 'systemBinary']) {
|
|
44
43
|
if (ourConfig[relativePathProp]) {
|
|
45
|
-
ourConfig[relativePathProp] = path_1.resolve(path_1.dirname(filename), ourConfig[relativePathProp]);
|
|
44
|
+
ourConfig[relativePathProp] = (0, path_1.resolve)((0, path_1.dirname)(filename), ourConfig[relativePathProp]);
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
|
-
lodash_defaultsdeep_1.default(_packageJsonConfig, ourConfig);
|
|
47
|
+
(0, lodash_defaultsdeep_1.default)(_packageJsonConfig, ourConfig);
|
|
49
48
|
}
|
|
50
49
|
packageJsonConfig = _packageJsonConfig;
|
|
51
50
|
}
|
|
@@ -57,15 +56,14 @@ findPackageJson();
|
|
|
57
56
|
*/
|
|
58
57
|
function resolveConfig(variableName) {
|
|
59
58
|
var _a, _b;
|
|
60
|
-
return ((_b = (_a = process.env[
|
|
59
|
+
return ((_b = (_a = process.env[`${ENV_CONFIG_PREFIX}${variableName}`]) !== null && _a !== void 0 ? _a : packageJsonConfig === null || packageJsonConfig === void 0 ? void 0 : packageJsonConfig[(0, camelcase_1.default)(variableName)]) !== null && _b !== void 0 ? _b : defaultValues.get(variableName));
|
|
61
60
|
}
|
|
62
61
|
exports.default = resolveConfig;
|
|
63
62
|
/**
|
|
64
63
|
* Convert "1, on, yes, true" to true (otherwise false)
|
|
65
64
|
* @param env The String / Environment Variable to check
|
|
66
65
|
*/
|
|
67
|
-
function envToBool(env) {
|
|
68
|
-
if (env === void 0) { env = ''; }
|
|
66
|
+
function envToBool(env = '') {
|
|
69
67
|
return ['1', 'on', 'yes', 'true'].indexOf(env.toLowerCase()) !== -1;
|
|
70
68
|
}
|
|
71
69
|
exports.envToBool = envToBool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-config.js","sourceRoot":"","sources":["../../src/util/resolve-config.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"resolve-config.js","sourceRoot":"","sources":["../../src/util/resolve-config.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAkC;AAClC,0EAAuC;AACvC,kDAA0B;AAC1B,+BAAwC;AACxC,8EAA+C;AAE/C,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,uBAAuB,CAAC,CAAC;AAE3C,MAAM,iBAAiB,GAAG,UAAU,CAAC;AACrC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEhD;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,GAAW,EAAE,KAAa;IACxD,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,C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