Skip to content

Commit

Permalink
fix data_disabled when features not opened
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Nov 20, 2023
1 parent ed55af8 commit 332dc53
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions src/wal/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,39 @@ pub enum StorageConfig {
impl StorageConfig {
pub fn data_disabled(&self) -> bool {
match self {
Self::RocksDB(c) => c.disable_data,
Self::Obkv(c) => c.disable_data,
Self::Kafka(c) => c.disable_data,
Self::RocksDB(c) => {
#[cfg(feature = "wal-rocksdb")]
{
c.disable_data
}
#[cfg(not(feature = "wal-rocksdb"))]
{
_ = c;
false
}
}
Self::Obkv(c) => {
#[cfg(feature = "wal-table-kv")]
{
c.disable_data
}
#[cfg(not(feature = "wal-table-kv"))]
{
_ = c;
false
}
}
Self::Kafka(c) => {
#[cfg(feature = "wal-message-queue")]
{
c.disable_data
}
#[cfg(not(feature = "wal-message-queue"))]
{
_ = c;
false
}
}
}
}
}

0 comments on commit 332dc53

Please sign in to comment.