Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
lostman committed Sep 12, 2023
1 parent 4d67730 commit 13c7746
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions packages/fuel-indexer/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use tracing::info;
#[cfg(feature = "api-server")]
use fuel_indexer_api_server::api::WebApi;

// Returns a future which completes when a shutdown signal has been reveived.
// Returns a future which completes when a shutdown signal has been received.
fn shutdown_signal_handler() -> std::io::Result<impl futures::Future<Output = ()>> {
let mut sighup: Signal = signal(SignalKind::hangup())?;
let mut sigterm: Signal = signal(SignalKind::terminate())?;
Expand Down Expand Up @@ -159,7 +159,7 @@ pub async fn exec(args: IndexerArgs) -> anyhow::Result<()> {
};
subsystems.spawn(async move {
if let Err(e) = FuelService::new_node(config).await {
tracing::error!("Fuen Node failed: {e}");
tracing::error!("Fuel Node failed: {e}");
};
});
}
Expand All @@ -168,7 +168,9 @@ pub async fn exec(args: IndexerArgs) -> anyhow::Result<()> {
// Each subsystem runs its own loop, and we require all subsystems for the
// Indexer service to operate correctly. If any of the subsystems stops
// running, the entire Indexer Service exits.
subsystems.join_next().await;
if let Some(_) = subsystems.join_next().await {
subsystems.shutdown().await;
}

if embedded_database {
let name = postgres_database.unwrap_or(defaults::POSTGRES_DATABASE.to_string());
Expand Down
2 changes: 1 addition & 1 deletion packages/fuel-indexer/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ impl WasmIndexExecutor {
Ok(executor) => Ok(executor),
Err(e) => {
error!(
"Could not instantiate WasmIndexExecutor({uid}) from ExecutorSource::Manifest: {e:?}."
"Could not instantiate WasmIndexExecutor({uid}): {e:?}."
);
Err(IndexerError::WasmExecutionInstantiationError)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/fuel-indexer/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ impl IndexerService {
}

// Spawn and register a tokio::task running the Executor loop, as well as
// the kill switch and the abort handle.ß
// the kill switch and the abort handle.
fn start_executor<T: 'static + Executor + Send + Sync>(&mut self, executor: T) {
let uid = executor.manifest().uid();

Expand Down

0 comments on commit 13c7746

Please sign in to comment.