store/postgres: Unwrap the worker handle in EntityChangeListener::drop
@@ -141,15 +141,14 @@ impl Drop for EntityChangeListener {
fn drop(&mut self) {
// When dropping the change listener, also make sure we signal termination
// to the worker and wait for it to shut down
- if let Some(worker_handle) = self.worker_handle.take() {
self.terminate_worker.store(true, Ordering::SeqCst);
-
- worker_handle
+ self.worker_handle
+ .take()
+ .unwrap()
.join()
.expect("failed to terminate EntityChangeListener thread");
}
}
-}
impl EventProducer<EntityChange> for EntityChangeListener {
fn take_event_stream(&mut self) -> Option<Box<Stream<Item = EntityChange, Error = ()> + Send>> {
