Skip to content

Commit

Permalink
writeCache function
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Jul 25, 2024
1 parent d92fae0 commit 4a11f77
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ abstract class MappingResolver<T : MappingResolver<T>>(val name: String) {

open suspend fun fromCache(key: String): MemoryMappingTree? = null

open suspend fun writeCache(key: String, tree: MemoryMappingTree) {}

open suspend fun resolve(): MemoryMappingTree {
if (::resolved.isInitialized) return resolved
return resolveLock.withLock {
Expand Down Expand Up @@ -205,6 +207,8 @@ abstract class MappingResolver<T : MappingResolver<T>>(val name: String) {
afterPropogate(resolved)
}
}

writeCache(cacheKey, resolved)
}

this.namespaces = sorted.flatMap { it.provides }.associate { it.first to it.second }
Expand Down

0 comments on commit 4a11f77

Please sign in to comment.