Remove hook timeout

This commit is contained in:
loicsaintroch 2016-01-19 17:06:09 +01:00
parent 0892e17f48
commit dba3ab248f

View File

@ -82,18 +82,7 @@ module.exports = function (strapi) {
// Load a hook and initialize it.
function loadHook(id, cb) {
const timeoutInterval = 5000;
let hookTimeout;
hookTimeout = setTimeout(function tooLong() {
const hooksTookTooLongErr = 'The hook `' + id + '` is taking too long to load.';
const err = new Error(hooksTookTooLongErr);
err.code = 'E_HOOK_TIMEOUT';
cb(err);
}, timeoutInterval);
hooks[id].load(function (err) {
clearTimeout(hookTimeout);
if (err) {
strapi.log.error('The hook `' + id + '` failed to load!');
strapi.emit('hook:' + id + ':error');