Skip to content

Commit

Permalink
creating state changes when new content is created through tasks (ten…
Browse files Browse the repository at this point in the history
  • Loading branch information
diptanu authored Feb 4, 2024
1 parent 5dea7d0 commit ba19914
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,14 @@ impl App {
executor_id: Option<String>,
content_meta_list: Vec<internal_api::ContentMetadata>,
) -> Result<()> {
let mut state_changes = vec![];
for content in &content_meta_list {
state_changes.push(StateChange::new(
content.id.clone(),
internal_api::ChangeType::NewContent,
timestamp_secs(),
));
}
let mark_finished = task.outcome != internal_api::TaskOutcome::Unknown;
let req = Request {
payload: RequestPayload::UpdateTask {
Expand All @@ -474,7 +482,7 @@ impl App {
executor_id: executor_id.clone(),
content_metadata: content_meta_list.clone(),
},
state_changes: vec![],
state_changes: state_changes,
};
let _resp = self.raft.client_write(req).await?;
Ok(())
Expand Down

0 comments on commit ba19914

Please sign in to comment.