Skip to content

Commit

Permalink
feat: set expire when create flow
Browse files Browse the repository at this point in the history
  • Loading branch information
discord9 committed May 16, 2024
1 parent f48c831 commit 1f4a901
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/flow/src/adapter/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ impl<'s> Worker<'s> {
create_if_not_exist: bool,
err_collector: ErrCollector,
) -> Result<Option<FlowId>, Error> {
let _ = expire_when;
let already_exist = self.task_states.contains_key(&flow_id);
match (already_exist, create_if_not_exist) {
(true, true) => return Ok(None),
Expand All @@ -220,6 +219,7 @@ impl<'s> Worker<'s> {
err_collector,
..Default::default()
};
cur_task_state.state.set_expire_after(expire_when);

{
let mut ctx = cur_task_state.new_ctx(sink_id);
Expand Down
4 changes: 4 additions & 0 deletions src/flow/src/compute/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ impl DataflowState {
self.err_collector.clone()
}

pub fn set_expire_after(&mut self, after: Option<repr::Duration>) {
self.expire_after = after;
}

pub fn expire_after(&self) -> Option<Timestamp> {
self.expire_after
}
Expand Down

0 comments on commit 1f4a901

Please sign in to comment.