clean up handling of errors in route spec store

This commit is contained in:
Christien Rioux
2023-10-20 22:39:09 -04:00
parent 353c907497
commit 97be49a9a7
17 changed files with 278 additions and 236 deletions

View File

@@ -191,7 +191,7 @@ pub fn initialize_veilid_wasm() {
static INITIALIZED: AtomicBool = AtomicBool::new(false);
#[wasm_bindgen()]
pub fn initialize_veilid_core(platform_config: String) {
if INITIALIZED.swap(true, Ordering::Relaxed) {
if INITIALIZED.swap(true, Ordering::AcqRel) {
return;
}
let platform_config: VeilidWASMConfig = veilid_core::deserialize_json(&platform_config)

View File

@@ -30,7 +30,7 @@ pub struct VeilidClient {}
#[wasm_bindgen(js_class = veilidClient)]
impl VeilidClient {
pub async fn initializeCore(platformConfig: VeilidWASMConfig) {
if INITIALIZED.swap(true, Ordering::Relaxed) {
if INITIALIZED.swap(true, Ordering::AcqRel) {
return;
}
console_error_panic_hook::set_once();