mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
add the version to the index-scheduler snapshots + fix a bug when opening an index scheduler for the first time
This commit is contained in:
parent
b9e9fc376a
commit
7eb23f73ba
4 changed files with 23 additions and 2 deletions
|
@ -6,6 +6,7 @@ use time::OffsetDateTime;
|
|||
use tracing::info;
|
||||
|
||||
use crate::queue::TaskQueue;
|
||||
use crate::versioning::Versioning;
|
||||
|
||||
trait UpgradeIndexScheduler {
|
||||
fn upgrade(&self, env: &Env, wtxn: &mut RwTxn, original: (u32, u32, u32))
|
||||
|
@ -15,6 +16,7 @@ trait UpgradeIndexScheduler {
|
|||
|
||||
pub fn upgrade_index_scheduler(
|
||||
env: &Env,
|
||||
versioning: &Versioning,
|
||||
from: (u32, u32, u32),
|
||||
to: (u32, u32, u32),
|
||||
) -> anyhow::Result<()> {
|
||||
|
@ -55,6 +57,7 @@ pub fn upgrade_index_scheduler(
|
|||
);
|
||||
let mut wtxn = env.write_txn()?;
|
||||
upgrade.upgrade(env, &mut wtxn, from)?;
|
||||
versioning.set_version(&mut wtxn, target)?;
|
||||
wtxn.commit()?;
|
||||
current_version = target;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue