mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Documented manager code
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user