Skip to content

Commit

Permalink
fixTM the node bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmTomahawkx committed Nov 24, 2024
1 parent 9ea5da8 commit 0643a38
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions crates/bindings/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ use neon::prelude::*;
use revolt_database::{Database, DatabaseInfo};

fn js_init(mut cx: FunctionContext) -> JsResult<JsUndefined> {
static INIT: OnceLock<()> = OnceLock::new();
if INIT.get().is_none() {
INIT.get_or_init(|| {
async_std::task::block_on(async {
revolt_config::configure!(api);

match DatabaseInfo::Auto.connect().await {
Ok(db) => {
let authifier_db = db.clone().to_authifier().await.database;
revolt_database::tasks::start_workers(db, authifier_db);
Ok(())
}
Err(err) => Err(err),
}
})
.or_else(|err| cx.throw_error(err))
.unwrap();
});
}
// static INIT: OnceLock<()> = OnceLock::new();
// if INIT.get().is_none() {
// INIT.get_or_init(|| {
// async_std::task::block_on(async {
// revolt_config::configure!(api);

// match DatabaseInfo::Auto.connect().await {
// Ok(db) => {
// let authifier_db = db.clone().to_authifier().await.database;
// revolt_database::tasks::start_workers(db, authifier_db);
// Ok(())
// }
// Err(err) => Err(err),
// }
// })
// .or_else(|err| cx.throw_error(err))
// .unwrap();
// });
// }

Ok(cx.undefined())
}
Expand Down

0 comments on commit 0643a38

Please sign in to comment.