replace with custom superagent based on fetch API

This commit is contained in:
Girish Ramakrishnan
2025-02-14 17:26:54 +01:00
parent 68a08b1f62
commit 8e58349bfa
66 changed files with 1086 additions and 1031 deletions
+2 -2
View File
@@ -68,7 +68,7 @@ const addonConfigs = require('./addonconfigs.js'),
settings = require('./settings.js'),
sftp = require('./sftp.js'),
shell = require('./shell.js')('services'),
superagent = require('superagent');
superagent = require('./superagent.js');
const NOOP = async function (/*app, options*/) {};
const RMADDONDIR_CMD = path.join(__dirname, 'scripts/rmaddondir.sh');
@@ -334,7 +334,7 @@ async function containerStatus(containerName, tokenEnvName) {
.ok(() => true));
if (networkError) return { status: exports.SERVICE_STATUS_STARTING, error: `Error waiting for ${containerName}: ${networkError.message}` };
if (response.status !== 200 || !response.body.status) return { status: exports.SERVICE_STATUS_STARTING, error: `Error waiting for ${containerName}. Status code: ${response.statusCode} message: ${response.body.message}` };
if (response.status !== 200 || !response.body.status) return { status: exports.SERVICE_STATUS_STARTING, error: `Error waiting for ${containerName}. Status code: ${response.status} message: ${response.body.message}` };
const result = await docker.memoryUsage(containerName);
const stats = result.memory_stats || { usage: 0, limit: 1 };