mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2024-11-20 15:05:19 +00:00
do not fail on prune error (#168)
Some checks are pending
abi-consistent-check / build-and-compare (push) Waiting to run
code-coverage / unittest-cov (push) Waiting to run
rust / check (push) Waiting to run
rust / test (push) Waiting to run
rust / lints (push) Waiting to run
functional-test / test (push) Waiting to run
Some checks are pending
abi-consistent-check / build-and-compare (push) Waiting to run
code-coverage / unittest-cov (push) Waiting to run
rust / check (push) Waiting to run
rust / test (push) Waiting to run
rust / lints (push) Waiting to run
functional-test / test (push) Waiting to run
* do not fail on prune error
This commit is contained in:
parent
1c72607fbc
commit
780865b1b8
@ -15,7 +15,7 @@ use storage::log_store::log_manager::PORA_CHUNK_SIZE;
|
|||||||
use storage_async::Store;
|
use storage_async::Store;
|
||||||
use task_executor::TaskExecutor;
|
use task_executor::TaskExecutor;
|
||||||
use tokio::sync::{broadcast, mpsc};
|
use tokio::sync::{broadcast, mpsc};
|
||||||
use tracing::{debug, info};
|
use tracing::{debug, error, info};
|
||||||
use zgs_spec::SECTORS_PER_PRICING;
|
use zgs_spec::SECTORS_PER_PRICING;
|
||||||
|
|
||||||
// Start pruning when the db directory size exceeds 0.9 * limit.
|
// Start pruning when the db directory size exceeds 0.9 * limit.
|
||||||
@ -116,7 +116,8 @@ impl Pruner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check no reward chunks and prune.
|
// Check no reward chunks and prune.
|
||||||
let new_first_rewardable = self.reward_contract.first_rewardable_chunk().call().await?;
|
match self.reward_contract.first_rewardable_chunk().call().await {
|
||||||
|
Ok(new_first_rewardable) => {
|
||||||
if let Some(no_reward_list) = self
|
if let Some(no_reward_list) = self
|
||||||
.maybe_forward_first_rewardable(new_first_rewardable)
|
.maybe_forward_first_rewardable(new_first_rewardable)
|
||||||
.await?
|
.await?
|
||||||
@ -139,6 +140,11 @@ impl Pruner {
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
e => {
|
||||||
|
error!("handle reward contract read fails, e={:?}", e);
|
||||||
|
}
|
||||||
|
};
|
||||||
tokio::time::sleep(self.config.check_time).await;
|
tokio::time::sleep(self.config.check_time).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user