Skip to content

Commit

Permalink
trivial: hack around IDE bug
Browse files Browse the repository at this point in the history
CLion currently has difficalty indexing `#[cfg(not(test))]`, and this
gets around that

Closes: aptos-labs#814
  • Loading branch information
msmouse authored and aptos-bot committed May 5, 2022
1 parent 193b7cf commit 28a8050
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions storage/aptosdb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,7 @@ impl RocksdbPropertyReporter {
);
}
// report rocksdb properties each 10 seconds
#[cfg(not(test))]
const TIMEOUT_MS: u64 = 10000;
#[cfg(test)]
const TIMEOUT_MS: u64 = 10;
const TIMEOUT_MS: u64 = if cfg!(test) { 10 } else { 10000 };

match recv.recv_timeout(Duration::from_millis(TIMEOUT_MS)) {
Ok(_) => break,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ use storage_interface::DbReaderWriter;
use structopt::StructOpt;
use tokio::io::BufReader;

#[cfg(not(test))]
const BATCH_SIZE: usize = 10000;
#[cfg(test)]
const BATCH_SIZE: usize = 2;
const BATCH_SIZE: usize = if cfg!(test) { 2 } else { 10000 };

#[derive(StructOpt)]
pub struct TransactionRestoreOpt {
Expand Down

0 comments on commit 28a8050

Please sign in to comment.