Skip to content

Commit

Permalink
fix: shadow the election client for now
Browse files Browse the repository at this point in the history
  • Loading branch information
CookiePieWw committed Dec 20, 2024
1 parent d4df24d commit 12260fe
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/meta-srv/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,7 @@ use tonic::codec::CompressionEncoding;
use tonic::transport::server::{Router, TcpIncoming};

use crate::election::etcd::EtcdElection;
#[cfg(feature = "pg_kvbackend")]
use crate::election::postgres::PgElection;
#[cfg(feature = "pg_kvbackend")]
use crate::election::CANDIDATE_LEASE_SECS;
#[cfg(feature = "pg_kvbackend")]
use crate::error::InvalidArgumentsSnafu;
use crate::error::{InitExportMetricsTaskSnafu, TomlFormatSnafu};
use crate::error::{InitExportMetricsTaskSnafu, InvalidArgumentsSnafu, TomlFormatSnafu};

Check failure on line 48 in src/meta-srv/src/bootstrap.rs

View workflow job for this annotation

GitHub Actions / Check (ubuntu-20.04)

unused import: `InvalidArgumentsSnafu`

Check failure on line 48 in src/meta-srv/src/bootstrap.rs

View workflow job for this annotation

GitHub Actions / coverage

unused import: `InvalidArgumentsSnafu`
use crate::metasrv::builder::MetasrvBuilder;
use crate::metasrv::{BackendImpl, Metasrv, MetasrvOptions, SelectorRef};
use crate::selector::lease_based::LeaseBasedSelector;
Expand Down Expand Up @@ -231,15 +225,7 @@ pub async fn metasrv_builder(
let kv_backend = PgStore::with_pg_client(pg_client)
.await
.context(error::KvBackendSnafu)?;
let election_client = create_postgres_client(opts).await?;
let election = PgElection::with_pg_client(
opts.server_addr.clone(),
election_client,
opts.store_key_prefix.clone(),
CANDIDATE_LEASE_SECS,
)
.await?;
(kv_backend, Some(election))
(kv_backend, None)
}
};

Expand Down

0 comments on commit 12260fe

Please sign in to comment.