stagger initial scheduler ticks to avoid rebuild storm
test / unit + widget + golden + a11y (push) Failing after 33s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / unit + widget + golden + a11y (push) Failing after 33s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
Firing all tier ticks simultaneously on project open causes multiple IPC calls (pql, git, files) to run in parallel, their responses triggering rapid setState rebuilds that beachball the merged thread. Stagger 500ms apart so each panel refreshes sequentially. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
2f7435f271
commit
0485a36091
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"exported_at": "2026-05-01T09:40:12Z",
|
||||
"exported_at": "2026-05-01T09:41:42Z",
|
||||
"decisions": [
|
||||
{
|
||||
"id": "D-1",
|
||||
|
||||
@@ -50,10 +50,14 @@ class SchedulerService {
|
||||
void _startTicker() {
|
||||
_stopTicker();
|
||||
|
||||
// Immediate first tick for all tiers.
|
||||
// Stagger the initial ticks to avoid a rebuild storm on project open.
|
||||
var delay = 0;
|
||||
for (final tier in SchedulerTier.values) {
|
||||
if (tier == SchedulerTier.midnight) continue;
|
||||
_events.emit(SchedulerTick(tier: tier));
|
||||
Timer(Duration(milliseconds: delay), () {
|
||||
_events.emit(SchedulerTick(tier: tier));
|
||||
});
|
||||
delay += 500;
|
||||
}
|
||||
|
||||
// Then start the periodic isolate.
|
||||
|
||||
Reference in New Issue
Block a user