Skip to content

Commit

Permalink
fix: log websocket send error on canister
Browse files Browse the repository at this point in the history
  • Loading branch information
ilbertt committed Jun 23, 2024
1 parent 2e7b3f1 commit a97eaee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/backend/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ mod types;

use mappings::*;
use repositories::*;
use services::*;
pub use services::*;
pub use types::*;
2 changes: 1 addition & 1 deletion src/backend/src/api/services/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ pub(super) use akash_service::*;
pub(super) use config_service::*;
pub(super) use deployments_service::*;
pub(super) use ledger_service::*;
pub(super) use log_service::*;
pub use log_service::*;
pub(super) use users_service::*;
7 changes: 3 additions & 4 deletions src/backend/src/helpers/websocket.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use crate::api::DeploymentUpdateWsMessage;
use crate::api::{log_error, DeploymentUpdateWsMessage};
use ic_websocket_cdk::ClientPrincipal;

pub fn send_canister_update(client_principal: ClientPrincipal, update: DeploymentUpdateWsMessage) {
// print(format!("Sending message: {:?}", update));
if ic_websocket_cdk::send(client_principal, update.candid_serialize()).is_err() {
// print(format!("Could not send message: {}", e));
if let Err(e) = ic_websocket_cdk::send(client_principal, update.candid_serialize()) {
log_error!(format!("Failed to send ws message: {:?}", e), "websocket")
}
}

0 comments on commit a97eaee

Please sign in to comment.