Skip to content

Commit

Permalink
fix TravisCI eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
scream314 committed Feb 10, 2019
1 parent 65b1cba commit cafa991
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions lib/DefaultEvictor.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
"use strict";

class DefaultEvictor {
evict(config, pooledResource, availableObjectsCount) {
const idleTime = Date.now() - pooledResource.lastIdleTime;
evict(config, pooledResource, availableObjectsCount) {
const idleTime = Date.now() - pooledResource.lastIdleTime;

if (!idleTime) {
console.log('ERROR - idleTime is junk, evictig!', JSON.stringify({
idleTime,
pooledResource,
}));
return true;
}
if (!idleTime) {
console.log(
'ERROR - idleTime is junk, evictig!',
JSON.stringify({
idleTime,
pooledResource,
}));
return true;
}

if (
config.softIdleTimeoutMillis > 0 &&
config.softIdleTimeoutMillis < idleTime &&
config.min < availableObjectsCount
) {
return true;
}
if (
config.softIdleTimeoutMillis > 0 &&
config.softIdleTimeoutMillis < idleTime &&
config.min < availableObjectsCount
) {
return true;
}

if (config.idleTimeoutMillis < idleTime) {
return true;
}
if (config.idleTimeoutMillis < idleTime) {
return true;
}

return false;
}
return false;
}
}

module.exports = DefaultEvictor;

0 comments on commit cafa991

Please sign in to comment.