clear large profile cache
This commit is contained in:
parent
e01f6f6cb0
commit
a0bc179aea
1 changed files with 5 additions and 0 deletions
|
@ -94,6 +94,11 @@ class ProfileFunctionImplementation @Inject constructor(
|
|||
|
||||
@Synchronized
|
||||
override fun getProfile(time: Long): Profile? {
|
||||
// Clear cache after longer use
|
||||
if (cache.size() > 30000) {
|
||||
cache.clear()
|
||||
aapsLogger.debug("Profile cache cleared")
|
||||
}
|
||||
val rounded = time - time % 1000
|
||||
val cached = cache[rounded]
|
||||
if (cached != null) {
|
||||
|
|
Loading…
Reference in a new issue