-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3e3f044
commit b35fa92
Showing
7 changed files
with
47 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use std::sync::Arc; | ||
|
||
use entities::enums::AssetType; | ||
use rocks_db::{ | ||
key_encoders::encode_u64x2_pubkey, storage_traits::AssetUpdateIndexStorage, Storage, | ||
}; | ||
|
||
use crate::error::IngesterError; | ||
|
||
pub fn clean_syncronized_idxs( | ||
primary_rocks_storage: Arc<Storage>, | ||
asset_type: AssetType, | ||
) -> Result<(), IngesterError> { | ||
let optional_last_synced_key = match asset_type { | ||
AssetType::NonFungible => primary_rocks_storage.last_known_nft_asset_updated_key(), | ||
AssetType::Fungible => primary_rocks_storage.last_known_fungible_asset_updated_key(), | ||
}; | ||
|
||
if let Ok(Some(last_synced_key)) = optional_last_synced_key { | ||
let last_synced_key = encode_u64x2_pubkey( | ||
last_synced_key.seq, | ||
last_synced_key.slot, | ||
last_synced_key.pubkey, | ||
); | ||
primary_rocks_storage.clean_syncronized_idxs(asset_type, last_synced_key)?; | ||
}; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod fork_cleaner; | ||
pub mod indexer_cleaner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters