mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 03:55:07 +08:00
Only remap the main database once
This commit is contained in:
parent
7dd1226faf
commit
d050c9b4ae
@ -268,21 +268,10 @@ impl Index {
|
|||||||
) -> heed::Result<()> {
|
) -> heed::Result<()> {
|
||||||
let mut txn = env.write_txn()?;
|
let mut txn = env.write_txn()?;
|
||||||
// The db was just created, we update its metadata with the relevant information.
|
// The db was just created, we update its metadata with the relevant information.
|
||||||
if main
|
let main = main.remap_types::<Str, SerdeJson<OffsetDateTime>>();
|
||||||
.remap_types::<Str, SerdeJson<OffsetDateTime>>()
|
if main.get(&txn, main_key::CREATED_AT_KEY)?.is_none() {
|
||||||
.get(&txn, main_key::CREATED_AT_KEY)?
|
main.put(&mut txn, main_key::UPDATED_AT_KEY, &updated_at)?;
|
||||||
.is_none()
|
main.put(&mut txn, main_key::CREATED_AT_KEY, &created_at)?;
|
||||||
{
|
|
||||||
main.remap_types::<Str, SerdeJson<OffsetDateTime>>().put(
|
|
||||||
&mut txn,
|
|
||||||
main_key::UPDATED_AT_KEY,
|
|
||||||
&updated_at,
|
|
||||||
)?;
|
|
||||||
main.remap_types::<Str, SerdeJson<OffsetDateTime>>().put(
|
|
||||||
&mut txn,
|
|
||||||
main_key::CREATED_AT_KEY,
|
|
||||||
&created_at,
|
|
||||||
)?;
|
|
||||||
txn.commit()?;
|
txn.commit()?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user