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

* do not fail on prune error
This commit is contained in:
0g-peterzhb 2024-08-25 16:48:03 +08:00 committed by GitHub
parent 1c72607fbc
commit 780865b1b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,7 +15,7 @@ use storage::log_store::log_manager::PORA_CHUNK_SIZE;
use storage_async::Store;
use task_executor::TaskExecutor;
use tokio::sync::{broadcast, mpsc};
use tracing::{debug, info};
use tracing::{debug, error, info};
use zgs_spec::SECTORS_PER_PRICING;
// Start pruning when the db directory size exceeds 0.9 * limit.
@ -116,7 +116,8 @@ impl Pruner {
}
// 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
.maybe_forward_first_rewardable(new_first_rewardable)
.await?
@ -139,6 +140,11 @@ impl Pruner {
)
.await?;
}
}
e => {
error!("handle reward contract read fails, e={:?}", e);
}
};
tokio::time::sleep(self.config.check_time).await;
}
}