mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 22:11:06 +00:00
Store the database in a role specific subdirectory (#9645)
* Store the database in a role specific subdirectory This is a cleaned up version of #8658 fixing #6880 polkadot companion: paritytech/polkadot#2923 * Disable prometheus in tests * Also change p2p port * Fix migration logic * Use different identification file for rocks and parity db Add tests for paritydb migration
This commit is contained in:
committed by
GitHub
parent
4849e34270
commit
16144e7404
@@ -355,7 +355,7 @@ pub enum DatabaseSource {
|
||||
}
|
||||
|
||||
impl DatabaseSource {
|
||||
/// Return dabase path for databases that are on the disk.
|
||||
/// Return path for databases that are stored on disk.
|
||||
pub fn path(&self) -> Option<&Path> {
|
||||
match self {
|
||||
// as per https://github.com/paritytech/substrate/pull/9500#discussion_r684312550
|
||||
@@ -367,6 +367,22 @@ impl DatabaseSource {
|
||||
DatabaseSource::Custom(..) => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Set path for databases that are stored on disk.
|
||||
pub fn set_path(&mut self, p: &Path) -> bool {
|
||||
match self {
|
||||
DatabaseSource::Auto { ref mut paritydb_path, .. } => {
|
||||
*paritydb_path = p.into();
|
||||
true
|
||||
},
|
||||
DatabaseSource::RocksDb { ref mut path, .. } |
|
||||
DatabaseSource::ParityDb { ref mut path } => {
|
||||
*path = p.into();
|
||||
true
|
||||
},
|
||||
DatabaseSource::Custom(..) => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for DatabaseSource {
|
||||
|
||||
Reference in New Issue
Block a user