mirror of
https://github.com/enso-org/enso.git
synced 2024-11-23 08:08:34 +03:00
Update cache invalidation commands (#8634)
This commit is contained in:
parent
07d58f2c02
commit
2d628263ff
@ -322,19 +322,20 @@ final class EnsureCompiledJob(
|
||||
*
|
||||
* @param changeset the [[Changeset]] object capturing the previous
|
||||
* version of IR
|
||||
* @param ir the IR of compiled module
|
||||
* @return the list of cache invalidation commands
|
||||
*/
|
||||
private def buildCacheInvalidationCommands(
|
||||
changeset: Changeset[_],
|
||||
oldIRs: Seq[IR]
|
||||
ir: IR
|
||||
): Seq[CacheInvalidation] = {
|
||||
val invalidateExpressionsCommand =
|
||||
CacheInvalidation.Command.InvalidateKeys(
|
||||
changeset.invalidated
|
||||
)
|
||||
val oldUUIDs = oldIRs.flatMap(_.location()).flatMap(_.id()).distinct
|
||||
val moduleIds = ir.preorder().flatMap(_.location()).flatMap(_.id()).toSet
|
||||
val invalidateStaleCommand =
|
||||
CacheInvalidation.Command.InvalidateStale(oldUUIDs)
|
||||
CacheInvalidation.Command.InvalidateStale(moduleIds)
|
||||
Seq(
|
||||
CacheInvalidation(
|
||||
CacheInvalidation.StackSelector.All,
|
||||
@ -360,10 +361,7 @@ final class EnsureCompiledJob(
|
||||
changeset: Changeset[_]
|
||||
)(implicit ctx: RuntimeContext): Unit = {
|
||||
val invalidationCommands =
|
||||
buildCacheInvalidationCommands(
|
||||
changeset,
|
||||
module.getIr.preorder()
|
||||
)
|
||||
buildCacheInvalidationCommands(changeset, module.getIr)
|
||||
ctx.contextManager.getAllContexts.values
|
||||
.foreach { stack =>
|
||||
if (stack.nonEmpty && isStackInModule(module.getName, stack)) {
|
||||
|
Loading…
Reference in New Issue
Block a user