Skip to content

Commit

Permalink
Address review suggestion
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Hill <nickhill@us.ibm.com>
  • Loading branch information
njhill committed Nov 1, 2022
1 parent 0462b7b commit ac34cfe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/ibm/watson/modelmesh/ModelMesh.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ public abstract class ModelMesh extends ThriftService
// time before which we don't wait for migrated models to load elsewhere during pre-shutdown
protected static final long CUTOFF_AGE_MS = 60 * 60_000L; // 1 hour

protected static final long THREE_MINS_MS = 3 * 60_000L;

// max combined number of cache-hit/miss retries per request - mainly just a safeguard
protected static final int MAX_ITERATIONS = 8;

Expand Down Expand Up @@ -5936,7 +5938,7 @@ public void run() {
} else {
lastUsed = ce != null ? runtimeCache.getLastUsedTime(modelId) : -1L;
// Use shorter expiry age if model was used in last 3 minutes
final long expiryAge = (lastUsed > 0 && (now - lastUsed) < 180_000L)
final long expiryAge = (lastUsed > 0 && (now - lastUsed) < THREE_MINS_MS)
? IN_USE_LOAD_FAILURE_EXPIRY_MS : LOAD_FAILURE_EXPIRY_MS;
if (now - failedTime > expiryAge) {
remFailed = true;
Expand Down

0 comments on commit ac34cfe

Please sign in to comment.