Skip to content

Commit

Permalink
WIP: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
srh committed Jun 26, 2024
1 parent 20df7ed commit 8e29202
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
36 changes: 18 additions & 18 deletions packages/cubejs-backend-native/src/node_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,24 +141,24 @@ fn shutdown_interface(mut cx: FunctionContext) -> JsResult<JsPromise> {
let runtime = tokio_runtime_node(&mut cx)?;

runtime.spawn(async move {
log::warn!("inside shutdown_interface spawned thread");
match services

.stop_processing_loops()
.await {
Ok(_) => {
log::warn!("stop_processing_loops awaited");
deferred.settle_with(&channel, move |mut cx| Ok(cx.undefined())).await.unwrap();
},
Err(err) => {
log::warn!("stop_processing_loops erred");
channel.send(move |mut cx| {
let err = JsError::error(&mut cx, err.to_string()).unwrap();
deferred.reject(&mut cx, err);
Ok(())
});
}
};
log::warn!("inside shutdown_interface spawned thread");
match services.stop_processing_loops().await {
Ok(_) => {
log::warn!("stop_processing_loops awaited");
deferred
.settle_with(&channel, move |mut cx| Ok(cx.undefined()))
.await
.unwrap();
}
Err(err) => {
log::warn!("stop_processing_loops erred");
channel.send(move |mut cx| {
let err = JsError::error(&mut cx, err.to_string()).unwrap();
deferred.reject(&mut cx, err);
Ok(())
});
}
};
});

Ok(promise)
Expand Down
4 changes: 1 addition & 3 deletions rust/cubesql/cubesql/src/sql/postgres/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,7 @@ impl AsyncPostgresShim {
Ok(())
}

pub async fn write_admin_shutdown_fatal_message(
&mut self,
) -> Result<(), ConnectionError> {
pub async fn write_admin_shutdown_fatal_message(&mut self) -> Result<(), ConnectionError> {
buffer::write_message(
&mut bytes::BytesMut::new(),
&mut self.socket,
Expand Down

0 comments on commit 8e29202

Please sign in to comment.