Skip to content

Commit

Permalink
chore: check debug
Browse files Browse the repository at this point in the history
tmp
  • Loading branch information
ovr committed Feb 5, 2024
1 parent f0a94c3 commit 612ee8b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/cubejs-backend-native/src/channel.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use std::cell::RefCell;
use std::collections::HashMap;
#[cfg(build = "debug")]
use std::sync::atomic::AtomicU64;
#[cfg(debug_assertions)]
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;

use crate::transport::MapCubeErrExt;
use async_trait::async_trait;
use cubesql::transport::{SqlGenerator, SqlTemplates};
use cubesql::CubeError;
#[cfg(build = "debug")]
#[cfg(debug_assertions)]
use log::trace;
use neon::prelude::*;
use tokio::sync::oneshot;
Expand All @@ -22,11 +22,11 @@ type JsAsyncChannelCallback = Box<
+ Send,
>;

#[cfg(build = "debug")]
#[cfg(debug_assertions)]
static JS_ASYNC_CHANNEL_DEBUG_ID_SEQ: AtomicU64 = AtomicU64::new(0);

pub struct JsAsyncChannel {
#[cfg(build = "debug")]
#[cfg(debug_assertions)]
_id: u64,
callback: Option<JsAsyncChannelCallback>,
}
Expand All @@ -38,8 +38,8 @@ impl Finalize for JsAsyncChannel {}
fn js_async_channel_resolve(mut cx: FunctionContext) -> JsResult<JsUndefined> {
let this = cx.this().downcast_or_throw::<BoxedChannel, _>(&mut cx)?;

#[cfg(build = "debug")]
trace!("JsAsyncChannel.resolved {}", this.id);
#[cfg(debug_assertions)]
trace!("JsAsyncChannel.resolved {}", this.borrow()._id);

let result = cx.argument::<JsValue>(0)?;

Expand All @@ -55,8 +55,8 @@ fn js_async_channel_resolve(mut cx: FunctionContext) -> JsResult<JsUndefined> {
fn js_async_channel_reject(mut cx: FunctionContext) -> JsResult<JsUndefined> {
let this = cx.this().downcast_or_throw::<BoxedChannel, _>(&mut cx)?;

#[cfg(build = "debug")]
trace!("JsAsyncChannel.reject {}", this.id);
#[cfg(debug_assertions)]
trace!("JsAsyncChannel.reject {}", this.borrow()._id);

let error = cx.argument::<JsString>(0)?;

Expand Down Expand Up @@ -87,7 +87,7 @@ impl JsAsyncChannel {

pub fn new_raw(callback: JsAsyncChannelCallback) -> Self {
Self {
#[cfg(build = "debug")]
#[cfg(debug_assertions)]
_id: JS_ASYNC_CHANNEL_DEBUG_ID_SEQ.fetch_add(1, Ordering::SeqCst),
callback: Some(callback),
}
Expand Down

0 comments on commit 612ee8b

Please sign in to comment.