Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/rentals.picotech.app/public_html/node_modules/bull/lib/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 'use strict';
const errorObject = { value: null };
function tryCatch(fn, ctx, args) {
try {
return fn.apply(ctx, args);
} catch (e) {
errorObject.value = e;
return errorObject;
}
}
/**
* Waits for a redis client to be ready.
* @param {Redis} redis client
*/
function isRedisReady(client) {
return new Promise((resolve, reject) => {
if (client.status === 'ready') {
resolve();
} else {
function handleReady() {
client.removeListener('end', handleEnd);
client.removeListener('error', handleError);
resolve();
}
let lastError;
function handleError(err) {
lastError = err;
}
function handleEnd() {
client.removeListener('ready', handleReady);
client.removeListener('error', handleError);
reject(lastError);
}
client.once('ready', handleReady);
client.on('error', handleError);
client.once('end', handleEnd);
}
});
}
module.exports.errorObject = errorObject;
module.exports.tryCatch = tryCatch;
module.exports.isRedisReady = isRedisReady;
module.exports.emitSafe = function(emitter, event, ...args) {
try {
return emitter.emit(event, ...args);
} catch (err) {
try {
return emitter.emit('error', err);
} catch (err) {
// We give up if the error event also throws an exception.
console.error(err);
}
}
};
module.exports.MetricsTime = {
ONE_MINUTE: 1,
FIVE_MINUTES: 5,
FIFTEEN_MINUTES: 15,
THIRTY_MINUTES: 30,
ONE_HOUR: 60,
ONE_WEEK: 60 * 24 * 7,
TWO_WEEKS: 60 * 24 * 7 * 2,
ONE_MONTH: 60 * 24 * 7 * 2 * 4
};
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0042 ]-- |