Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove lazy_static dependency
  • Loading branch information
nicolas-juteau committed Apr 24, 2025
commit c88fc5776d579cea802965cea3c3182764feddf0
9 changes: 3 additions & 6 deletions chirpstack/src/codec/js_plugin/mod.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
// TODO: provide SHA hash of the script so it can be shown in UI? (to ensure CI correctness)

use crate::config;
use anyhow::Result;
use async_trait::async_trait;
use chrono::{DateTime, Utc};
use std::collections::HashMap;
use tokio::sync::RwLock;
use tracing::{info, trace, warn};
use std::sync::LazyLock;

pub mod passthrough;
pub mod plugin;

lazy_static! {
static ref CODEC_PLUGINS: RwLock<HashMap<String, Box<dyn Handler + Sync + Send>>> =
RwLock::new(HashMap::new());
}
static CODEC_PLUGINS: LazyLock<RwLock<HashMap<String, Box<dyn Handler + Sync + Send>>>> =
LazyLock::new(|| RwLock::new(HashMap::new()));

pub async fn setup() -> Result<()> {
info!("Setting up codec plugins");
Expand Down