Skip to content

Commit

Permalink
remove from dirty list again
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Sep 4, 2024
1 parent 7aaf344 commit 52c5eb4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ impl AggregatedDataUpdate {
dirty_tasks_update: HashMap::from([(task_id, 1)]),
}
}

pub fn no_longer_dirty_task(task_id: TaskId) -> Self {
Self {
unfinished: -1,
dirty_tasks_update: HashMap::from([(task_id, -1)]),
}
}
}

impl Add for AggregatedDataUpdate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
use turbo_tasks::TaskId;

use super::{
aggregation_update::{AggregationUpdateJob, AggregationUpdateQueue},
aggregation_update::{AggregatedDataUpdate, AggregationUpdateJob, AggregationUpdateQueue},
invalidate::make_task_dirty,
ExecuteContext, Operation,
};
Expand Down Expand Up @@ -38,10 +38,15 @@ pub enum OutdatedEdge {

impl CleanupOldEdgesOperation {
pub fn run(task_id: TaskId, outdated: Vec<OutdatedEdge>, ctx: ExecuteContext<'_>) {
let mut queue = AggregationUpdateQueue::new();
queue.push(AggregationUpdateJob::DataUpdate {
task_id,
update: AggregatedDataUpdate::no_longer_dirty_task(task_id),
});
CleanupOldEdgesOperation::RemoveEdges {
task_id,
outdated,
queue: AggregationUpdateQueue::new(),
queue,
}
.execute(&ctx);
}
Expand Down

0 comments on commit 52c5eb4

Please sign in to comment.