Skip to content

Commit

Permalink
rename other to merged
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav1dde committed Sep 30, 2024
1 parent fb24ff5 commit 746642d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions relay-server/src/services/project_upstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ struct ProjectStateChannel {
// Main broadcast channel.
channel: BroadcastChannel<UpstreamProjectState>,
// Additional broadcast channels tracked from merge operations.
other: Vec<BroadcastChannel<UpstreamProjectState>>,
merged: Vec<BroadcastChannel<UpstreamProjectState>>,
revision: Option<String>,
deadline: Instant,
no_cache: bool,
Expand All @@ -123,7 +123,7 @@ impl ProjectStateChannel {
Self {
no_cache,
channel: sender.into_channel(),
other: Vec::new(),
merged: Vec::new(),
revision,
deadline: now + timeout,
attempts: 0,
Expand Down Expand Up @@ -154,7 +154,7 @@ impl ProjectStateChannel {
}

pub fn send(self, state: UpstreamProjectState) {
for channel in self.other {
for channel in self.merged {
channel.send(state.clone());
}
self.channel.send(state)
Expand All @@ -167,7 +167,7 @@ impl ProjectStateChannel {
pub fn merge(&mut self, channel: ProjectStateChannel) {
let ProjectStateChannel {
channel,
other,
merged,
revision,
deadline,
no_cache,
Expand All @@ -176,8 +176,8 @@ impl ProjectStateChannel {
pending,
} = channel;

self.other.push(channel);
self.other.extend(other);
self.merged.push(channel);
self.merged.extend(merged);
if self.revision != revision {
self.revision = None;
}
Expand Down

0 comments on commit 746642d

Please sign in to comment.