mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(static-file): run producer only if passed non-empty targets (#7424)
This commit is contained in:
@ -124,6 +124,11 @@ impl<DB: Database> StaticFileProducerInner<DB> {
|
||||
/// NOTE: it doesn't delete the data from database, and the actual deleting (aka pruning) logic
|
||||
/// lives in the `prune` crate.
|
||||
pub fn run(&mut self, targets: StaticFileTargets) -> StaticFileProducerResult {
|
||||
// If there are no targets, do not produce any static files and return early
|
||||
if !targets.any() {
|
||||
return Ok(targets)
|
||||
}
|
||||
|
||||
debug_assert!(targets.is_contiguous_to_highest_static_files(
|
||||
self.static_file_provider.get_highest_static_files()
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user