mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 20:16:47 +03:00
Ensure execution is scheduled after compilation (#10883)
Scheduling of jobs is asynchronous and nothing prevents it from scheduling execution before compilation leading to stale nodes in GUI. The scenario is easily reproducible by adding a `Thread.sleep` before `EnsureCompiledJob` requests compilation locks. This change ensures that execution is only scheduled after compilation is finished, when an edit request is being processed. # Important Notes This fix was prompted by me getting random stale nodes after edits: ![Screenshot from 2024-08-23 16-53-26](https://github.com/user-attachments/assets/2b017539-c4bf-4d42-b597-216d887a4f4c) (it would never recover unless another edit was made)
This commit is contained in:
parent
3bfe963e32
commit
3d23e22c6f
@ -52,8 +52,9 @@ class EditFileCmd(request: Api.EditFileNotification)
|
|||||||
}
|
}
|
||||||
if (request.execute) {
|
if (request.execute) {
|
||||||
ctx.jobControlPlane.abortAllJobs()
|
ctx.jobControlPlane.abortAllJobs()
|
||||||
ctx.jobProcessor.run(new EnsureCompiledJob(Seq(request.path)))
|
ctx.jobProcessor
|
||||||
executeJobs.foreach(ctx.jobProcessor.run)
|
.run(new EnsureCompiledJob(Seq(request.path)))
|
||||||
|
.foreach(_ => executeJobs.foreach(ctx.jobProcessor.run))
|
||||||
} else if (request.idMap.isDefined) {
|
} else if (request.idMap.isDefined) {
|
||||||
ctx.jobProcessor.run(new EnsureCompiledJob(Seq(request.path)))
|
ctx.jobProcessor.run(new EnsureCompiledJob(Seq(request.path)))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user