Skip to content

Commit 9da4f77

Browse files
committed
mark_as_immutable
1 parent f742534 commit 9da4f77

File tree

1 file changed

+6
-0
lines changed
  • turbopack/crates/turbo-tasks-backend/src/backend

1 file changed

+6
-0
lines changed

turbopack/crates/turbo-tasks-backend/src/backend/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,12 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
16711671

16721672
let has_children = !new_children.is_empty();
16731673

1674+
// If the task is not stateful and has no children, it does not have a way to be invalidated
1675+
// and we can mark it as immutable.
1676+
if !stateful && !has_children {
1677+
task.mark_as_immutable();
1678+
}
1679+
16741680
// Prepare all new children
16751681
if has_children {
16761682
prepare_new_children(task_id, &mut task, &new_children, &mut queue);

0 commit comments

Comments
 (0)