Skip to content

Commit

Permalink
Use AgentTaskScheduler.INSTANCE for background cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mcculls committed Nov 23, 2020
1 parent 77c82dc commit faa701b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.github.benmanes.caffeine.cache.Caffeine;
import datadog.trace.api.Function;
import datadog.trace.bootstrap.WeakCache;
import datadog.trace.util.AgentTaskScheduler;
import java.util.concurrent.TimeUnit;

public class CaffeineWeakCache<K, V> implements WeakCache<K, V> {
Expand All @@ -22,6 +23,7 @@ public CaffeineWeakCache(long maxSize) {
.weakKeys()
.maximumSize(maxSize)
.expireAfterAccess(10, TimeUnit.MINUTES)
.executor(AgentTaskScheduler.INSTANCE)
.build();
}

Expand Down

0 comments on commit faa701b

Please sign in to comment.