mcopy/app/lib/processing/index.js

35 lines
1.0 KiB
JavaScript
Raw Normal View History

'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.Processing = void 0;
const exec_1 = require("exec");
class Processing {
constructor(url) {
this._baseUrl = (url.indexOf('http') === -1 && url.indexOf('://') === -1) ? `http://${url}` : url;
}
async move() {
return new Promise(async (resolve, reject) => {
const timeStart = +new Date();
const url = `${this._baseUrl}`;
const cmd = `curl --http0.9 ${url}`;
let res;
let ms;
//console.log(url)
try {
2024-04-06 23:09:50 +00:00
res = await (0, exec_1.exec)(cmd);
}
catch (err) {
return reject(err);
}
ms = (+new Date()) - timeStart;
return resolve(ms);
});
}
async setDir(dir) {
return new Promise((resolve, reject) => {
return resolve(0);
});
}
}
exports.Processing = Processing;
module.exports = { Processing };
//# sourceMappingURL=index.js.map