Skip to content

Commit

Permalink
Remove TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
slumber committed Jun 2, 2021
1 parent 1d04a04 commit 0a91552
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions core/bin/zksync_event_listener/src/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ impl StreamHandler<NotifyResult> for EventListener {
let pool = self.db_pool.clone();
let last_processed_event_id = self.last_processed_event_id;
async move {
// Try to fetch and deserialize new events.
Ok(pool
.access_storage()
.await?
Expand Down Expand Up @@ -86,8 +87,6 @@ impl StreamHandler<NotifyResult> for EventListener {
err
);
}
// The server monitor doesn't have a timeout on its
// mailbox, thus, stop the context no matter what.
if shutdown {
ctx.stop();
}
Expand Down
3 changes: 0 additions & 3 deletions core/bin/zksync_event_listener/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ fn main() {
let _sentry_guard = vlog::init();
let config = ZkSyncConfig::from_env();

// TODO: `stop_on_panic` has no effect cause of tokio implementation.
// Instead, the server should shutdown itself in case of an error. (ZKS-654).
let mut sys = actix_web::rt::System::builder()
.name("event-listener")
.stop_on_panic(true)
.build();

sys.block_on(run_event_server(config));
Expand Down
1 change: 1 addition & 0 deletions core/bin/zksync_event_listener/src/subscriber/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ impl Handler<Shutdown> for Subscriber {
description: Some("internal server error".to_string()),
});
ctx.close(reason);
// No need to notify the monitor, stop the context right away.
ctx.stop();
}
}

0 comments on commit 0a91552

Please sign in to comment.