Skip to content

Commit 70c4b55

Browse files
committed
store: Do not log subscribe/unsubscribe
The log messages were not really useful for anything
1 parent 9ff3957 commit 70c4b55

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

store/postgres/src/store_events.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ impl EventProducer<StoreEvent> for StoreEventListener {
5353
/// Manage subscriptions to the `StoreEvent` stream. Keep a list of
5454
/// currently active subscribers and forward new events to each of them
5555
pub struct SubscriptionManager {
56-
logger: Logger,
5756
subscriptions: Arc<RwLock<HashMap<String, Sender<Arc<StoreEvent>>>>>,
5857

5958
/// listen to StoreEvents generated when applying entity operations
@@ -68,7 +67,6 @@ impl SubscriptionManager {
6867
.expect("Failed to listen to entity change events in Postgres");
6968

7069
let manager = SubscriptionManager {
71-
logger,
7270
subscriptions: Arc::new(RwLock::new(HashMap::new())),
7371
listener: Mutex::new(listener),
7472
};
@@ -91,28 +89,24 @@ impl SubscriptionManager {
9189
&self,
9290
store_events: Box<dyn Stream<Item = StoreEvent, Error = ()> + Send>,
9391
) {
94-
let logger = self.logger.clone();
9592
let subscriptions = self.subscriptions.clone();
9693

9794
graph::spawn(
9895
store_events
9996
.for_each(move |event| {
10097
let senders = subscriptions.read().unwrap().clone();
101-
let logger = logger.clone();
10298
let subscriptions = subscriptions.clone();
10399
let event = Arc::new(event);
104100

105101
// Write change to all matching subscription streams; remove subscriptions
106102
// whose receiving end has been dropped
107103
stream::iter_ok::<_, ()>(senders).for_each(move |(id, sender)| {
108-
let logger = logger.clone();
109104
let subscriptions = subscriptions.clone();
110105

111106
sender.send(event.cheap_clone()).then(move |result| {
112107
match result {
113108
Err(_send_error) => {
114109
// Receiver was dropped
115-
debug!(logger, "Unsubscribe"; "id" => &id);
116110
subscriptions.write().unwrap().remove(&id);
117111
Ok(())
118112
}
@@ -128,7 +122,6 @@ impl SubscriptionManager {
128122
fn periodically_clean_up_stale_subscriptions(&self) {
129123
use futures03::stream::StreamExt;
130124

131-
let logger = self.logger.clone();
132125
let subscriptions = self.subscriptions.clone();
133126

134127
// Clean up stale subscriptions every 5s
@@ -147,7 +140,6 @@ impl SubscriptionManager {
147140

148141
// Remove all stale subscriptions
149142
for id in stale_ids {
150-
debug!(logger, "Unsubscribe"; "id" => &id);
151143
subscriptions.remove(&id);
152144
}
153145

@@ -165,10 +157,6 @@ impl SubscriptionManager {
165157
id = Uuid::new_v4().to_string();
166158
}
167159

168-
debug!(self.logger, "Subscribe";
169-
"id" => &id,
170-
"entities" => format!("{:?}", entities));
171-
172160
// Prepare the new subscription by creating a channel and a subscription object
173161
let (sender, receiver) = channel(100);
174162

0 commit comments

Comments
 (0)