Skip to content

Commit 2ecbf4f

Browse files
authored
Merge ingester status and status_tx fields (#6544)
1 parent 55141d0 commit 2ecbf4f

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • quickwit/quickwit-ingest/src/ingest_v2

quickwit/quickwit-ingest/src/ingest_v2/state.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,15 @@ pub(super) struct InnerIngesterState {
6565
pub replication_tasks: HashMap<LeaderId, ReplicationTaskHandle>,
6666
cluster: Cluster,
6767
pub wal_capacity_tracker: WalCapacityTracker,
68-
status: IngesterStatus,
6968
status_tx: watch::Sender<IngesterStatus>,
7069
}
7170

7271
impl InnerIngesterState {
7372
pub fn status(&self) -> IngesterStatus {
74-
self.status
73+
*self.status_tx.borrow()
7574
}
7675

7776
pub async fn set_status(&mut self, status: IngesterStatus) {
78-
self.status = status;
7977
self.status_tx.send(status).expect("channel should be open");
8078
self.cluster
8179
.set_self_key_value(INGESTER_STATUS_KEY, status.as_json_str_name())
@@ -156,7 +154,6 @@ impl IngesterState {
156154
replication_tasks: Default::default(),
157155
cluster,
158156
wal_capacity_tracker: WalCapacityTracker::new(disk_capacity, memory_capacity),
159-
status,
160157
status_tx,
161158
};
162159
// We call `set_status` here instead of setting it directly because it also updates the

0 commit comments

Comments
 (0)