flush on change metadata
This commit is contained in:
parent
ee432a0421
commit
cfc2ff5886
@ -165,7 +165,7 @@ impl DataStore {
|
|||||||
file.write_all(data)
|
file.write_all(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn flush_metadata(&self) -> io::Result<()> {
|
pub fn flush_metadata(&self) -> io::Result<()> {
|
||||||
let f = metadata_file::MetadataFile::from_iterator(self.textures.iter());
|
let f = metadata_file::MetadataFile::from_iterator(self.textures.iter());
|
||||||
|
|
||||||
f.store(self.index_file_path().as_path())
|
f.store(self.index_file_path().as_path())
|
||||||
|
@ -102,6 +102,8 @@ impl ProtocolHandler for ServerState {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data_store.flush_metadata()?;
|
||||||
|
|
||||||
Ok(ReplaceTextureStatus::Ok)
|
Ok(ReplaceTextureStatus::Ok)
|
||||||
}
|
}
|
||||||
(Some(delete), None) => {
|
(Some(delete), None) => {
|
||||||
@ -111,6 +113,8 @@ impl ProtocolHandler for ServerState {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data_store.flush_metadata()?;
|
||||||
|
|
||||||
Ok(ReplaceTextureStatus::Ok)
|
Ok(ReplaceTextureStatus::Ok)
|
||||||
}
|
}
|
||||||
(None, Some(insert)) => {
|
(None, Some(insert)) => {
|
||||||
@ -125,6 +129,8 @@ impl ProtocolHandler for ServerState {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data_store.flush_metadata()?;
|
||||||
|
|
||||||
Ok(ReplaceTextureStatus::Ok)
|
Ok(ReplaceTextureStatus::Ok)
|
||||||
}
|
}
|
||||||
(None, None) => Ok(ReplaceTextureStatus::Ok),
|
(None, None) => Ok(ReplaceTextureStatus::Ok),
|
||||||
|
Loading…
Reference in New Issue
Block a user