Added test configuration

Summary
===
- Commandline Option --test exists the process after 30000 seconds with code 0 or exits with code 1 if an error occurs.
pull/4/head
Trivernis 6 years ago committed by GitHub
parent 3a0cfef640
commit eef072c2f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -107,7 +107,7 @@ function main() {
logger.info("Shutting Down...");
prepro.cleanup();
winston.end();
return false;
process.exit(1);
}
}
@ -137,6 +137,7 @@ function getResponse(uri) {
return [gp(mount || path.join(route["path"], uri)), route["mime"]]; // get processed output (done by preprocessor)
} catch (error) {
logger.error(error);
if (args.test) process.exit(1);
return ["Error", "text/plain"];
}
}
@ -168,5 +169,6 @@ if (typeof require !== 'undefined' && require.main === module) {
})
);
logger.info("Starting up... "); // log the current date so that the logfile is better to read.
if (args.test) setTimeout(() => process.exit(0), 30000);
main();
}

Loading…
Cancel
Save