fix: use TIMEOUTS constants instead of magic numbers in health and services routes
- health.js: replace magic number 5000 with TIMEOUTS.HTTP_DEFAULT (twice) - services.js: replace magic number 5000 with TIMEOUTS.HTTP_DEFAULT Both files already import TIMEOUTS from constants but weren't using it.
This commit is contained in:
@@ -113,7 +113,7 @@ module.exports = function({
|
||||
const headers = {};
|
||||
if (pylonConfig.key) headers['x-pylon-key'] = pylonConfig.key;
|
||||
const controller = new AbortController();
|
||||
const timeout = setTimeout(() => controller.abort(), 5000);
|
||||
const timeout = setTimeout(() => controller.abort(), TIMEOUTS.HTTP_DEFAULT);
|
||||
const response = await fetchT(probeUrl, { method: 'GET', signal: controller.signal, headers });
|
||||
clearTimeout(timeout);
|
||||
if (!response.ok) return null;
|
||||
|
||||
Reference in New Issue
Block a user