Added proxy test.
This commit is contained in:
12
src/app.js
12
src/app.js
@@ -112,6 +112,16 @@ async function startMemorySample(snapshotTriggers = []) {
|
||||
}, config.memorySampling.sampleDuration);
|
||||
}
|
||||
|
||||
async function testProxy() {
|
||||
if (config.proxy.enable && argv.testProxy) {
|
||||
const res = await unprint.get(argv.testProxy);
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(`Proxy is offline (${res.status})`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function init() {
|
||||
try {
|
||||
await redis.connect();
|
||||
@@ -186,6 +196,8 @@ async function init() {
|
||||
console.log(res.status, res.body);
|
||||
}
|
||||
|
||||
await testProxy();
|
||||
|
||||
const actorsFromFile = argv.actorsFile && await getFileEntries(argv.actorsFile);
|
||||
const actorNames = (argv.actors || []).concat(actorsFromFile || []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user