Documented manager code

This commit is contained in:
Pax1601
2024-01-03 15:08:06 +01:00
parent 7bf6c1bb23
commit a0634a7f99
11 changed files with 263 additions and 82 deletions

View File

@@ -1,5 +1,8 @@
const portfinder = require('portfinder')
/** Checks if a port is already in use
*
*/
function checkPort(port, callback) {
portfinder.getPort({ port: port, stopPort: port }, (err, res) => {
if (err !== null) {
@@ -11,6 +14,9 @@ function checkPort(port, callback) {
});
}
/** Performs a fetch request, with a configurable timeout
*
*/
async function fetchWithTimeout(resource, options = {}) {
const { timeout = 8000 } = options;