Changed log for cache

This commit is contained in:
zeldaroot 2020-01-13 01:57:33 +02:00
parent 2144966187
commit e6f3fdaf82
7 changed files with 25 additions and 9 deletions

View file

@ -1922,7 +1922,11 @@ var sint = setInterval(function() {
if (err || stderr) console.error(err || stderr);
console.log('Flush memcached');
CP_cache.flush(function(err) {
if (err) console.error(err);
if (err) {
if ((err + '').indexOf('not available') === -1) {
console.error(err);
}
}
return process.exit(0);
});
});

2
lib/CP_get.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -639,7 +639,7 @@ function recentComments(service, options, callback) {
console.log(
'[modules/CP_comments.js:recentComments] Cache Length Error'
);
} else {
} else if ((err + '').indexOf('not available') === -1) {
console.log(
'[modules/CP_comments.js:recentComments] Cache Set Error:',
err

View file

@ -900,7 +900,11 @@ router.post('/change', function(req, res) {
flush_memcached: function(callback) {
if (!form.flush_memcached) return callback(null, 'Null');
CP_cache.flush(function(err) {
if (err) console.error(err);
if (err) {
if ((err + '').indexOf('not available') === -1) {
console.error(err);
}
}
process.env.CP_VER = process.env.CP_VER
? parseInt(process.env.CP_VER) + 1
: new Date().getTime().toString();

View file

@ -62,7 +62,11 @@ router.get('/?', function(req, res, next) {
function getCache(callback) {
CP_cache.get(urlHash, function(err, render) {
if (err) console.error(err);
if (err) {
if ((err + '').indexOf('not available') === -1) {
console.error(err);
}
}
return render
? callback(null, render)
@ -223,7 +227,7 @@ router.get('/?', function(req, res, next) {
if (err) {
if ((err + '').indexOf('1048576') + 1) {
console.log('[routes/rss.js:renderData] Cache Length Error');
} else {
} else if ((err + '').indexOf('not available') === -1) {
console.log(
'[routes/rss.js:renderData] Cache Set Error:',
err

View file

@ -148,7 +148,11 @@ router.get('/:level1?/:level2?/:level3?/:level4?', function(req, res, next) {
function getCache(callback) {
CP_cache.get(urlHash, function(err, render) {
if (err) console.error(err);
if (err) {
if ((err + '').indexOf('not available') === -1) {
console.error(err);
}
}
return render
? callback(null, render)
@ -518,7 +522,7 @@ router.get('/:level1?/:level2?/:level3?/:level4?', function(req, res, next) {
'[routes/website.js:renderData] Cache Length Error:',
url
);
} else {
} else if ((err + '').indexOf('not available') === -1) {
console.log(
'[routes/website.js:renderData] Cache Set Error:',
err