Skip to content

Commit 50b1761

Browse files
committed
fix: remove clustered, port from Appp struct
1 parent b12b190 commit 50b1761

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

sentry/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ pub struct Application<A: Adapter> {
6363
pub logger: Logger,
6464
pub redis: MultiplexedConnection,
6565
pub pool: DbPool,
66-
pub _clustered: bool,
67-
pub port: u16,
6866
pub config: Config,
6967
__secret: (),
7068
}
@@ -76,17 +74,13 @@ impl<A: Adapter + 'static> Application<A> {
7674
logger: Logger,
7775
redis: MultiplexedConnection,
7876
pool: DbPool,
79-
clustered: bool,
80-
port: u16,
8177
) -> Self {
8278
Self {
8379
adapter,
8480
config,
8581
logger,
8682
redis,
8783
pool,
88-
_clustered: clustered,
89-
port,
9084
__secret: (),
9185
}
9286
}

sentry/src/main.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,19 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
104104

105105
match adapter {
106106
AdapterTypes::EthereumAdapter(adapter) => {
107-
run(Application::new(
108-
*adapter, config, logger, redis, postgres, clustered, port,
109-
))
107+
run(
108+
Application::new(*adapter, config, logger, redis, postgres),
109+
clustered,
110+
port,
111+
)
110112
.await
111113
}
112114
AdapterTypes::DummyAdapter(adapter) => {
113-
run(Application::new(
114-
*adapter, config, logger, redis, postgres, clustered, port,
115-
))
115+
run(
116+
Application::new(*adapter, config, logger, redis, postgres),
117+
clustered,
118+
port,
119+
)
116120
.await
117121
}
118122
};
@@ -121,10 +125,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
121125
}
122126

123127
/// Starts the `hyper` `Server`.
124-
async fn run<A: Adapter + 'static>(app: Application<A>) {
125-
let addr = ([127, 0, 0, 1], app.port).into();
128+
async fn run<A: Adapter + 'static>(app: Application<A>, _clustered: bool, port: u16) {
129+
let addr = ([127, 0, 0, 1], port).into();
126130
let logger = app.logger.clone();
127-
info!(&logger, "Listening on port {}!", app.port);
131+
info!(&logger, "Listening on port {}!", port);
128132

129133
let make_service = make_service_fn(move |_| {
130134
let server = app.clone();

0 commit comments

Comments
 (0)