Skip to content

Commit

Permalink
enhance event handling to include Metadata modifications for hot-relo…
Browse files Browse the repository at this point in the history
…ading

Signed-off-by: Ray Lee <[email protected]>
  • Loading branch information
hburaylee committed Jun 4, 2024
1 parent d89ba3b commit 50e7e52
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions binaries/cli/src/attach.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,27 @@ pub fn attach_dataflow(
let hash = node_path_lookup.clone();
let paths = hash.keys();
let notifier = move |event| {
if let Ok(NotifyEvent {
paths,
kind: EventKind::Modify(ModifyKind::Data(_data)),
..
}) = event
{
for path in paths {
if let Some((dataflow_id, node_id, operator_id)) = node_path_lookup.get(&path) {
watcher_tx
.send(ControlRequest::Reload {
dataflow_id: *dataflow_id,
node_id: node_id.clone(),
operator_id: operator_id.clone(),
})
.context("Could not send reload request to the cli loop")
.unwrap();
if let Ok(NotifyEvent { paths, kind, .. }) = event {
match kind {
EventKind::Modify(ModifyKind::Data(_))
| EventKind::Modify(ModifyKind::Metadata(_)) => {
for path in paths {
if let Some((dataflow_id, node_id, operator_id)) =
node_path_lookup.get(&path)
{
watcher_tx
.send(ControlRequest::Reload {
dataflow_id: *dataflow_id,
node_id: node_id.clone(),
operator_id: operator_id.clone(),
})
.context("Could not send reload request to the cli loop")
.unwrap();
}
}
}
_ => {} // TODO: Manage different file event
}
// TODO: Manage different file event
}
};

Expand Down

0 comments on commit 50e7e52

Please sign in to comment.