MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / new

Method new

chirpstack-integration/src/lib.rs:139–158  ·  view source on GitHub ↗
(conf: &Configuration)

Source from the content-addressed store, hash-verified

137
138impl Integration {
139 fn new(conf: &Configuration) -> Result<Self> {
140 info!("Initializing ChirpStack Integration backend");
141
142 let redis_client = if conf.redis.cluster {
143 info!("Setting up Redis Cluster client");
144 RedisClient::ClusterClient(
145 redis::cluster::ClusterClientBuilder::new(conf.redis.servers.clone()).build()?,
146 )
147 } else {
148 info!(server = %conf.redis.servers[0], "Setting up Redis client");
149 RedisClient::Client(redis::Client::open(conf.redis.servers[0].clone())?)
150 };
151
152 Ok(Integration {
153 redis_client,
154 key_prefix: conf.redis.key_prefix.clone(),
155 consumer_group: conf.redis.consumer_group.clone(),
156 consumer_name: conf.redis.consumer_name.clone(),
157 })
158 }
159
160 async fn start(&self) -> Result<()> {
161 info!("Getting Redis connection");

Callers

nothing calls this directly

Calls 1

ClientClass · 0.85

Tested by

no test coverage detected