mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
WIT: it compiles but the processing of tasks and loading of snapshots is still not implemented
This commit is contained in:
parent
03b510945b
commit
366144146b
3 changed files with 13 additions and 13 deletions
|
@ -40,7 +40,7 @@ use meilisearch_types::{compression, milli, VERSION_FILE_NAME};
|
|||
pub use option::Opt;
|
||||
use option::ScheduleSnapshot;
|
||||
use strois::Bucket;
|
||||
use zookeeper::ZooKeeper;
|
||||
use zookeeper_client_sync::Zookeeper;
|
||||
|
||||
use crate::error::MeilisearchHttpError;
|
||||
|
||||
|
@ -140,7 +140,7 @@ enum OnFailure {
|
|||
|
||||
pub async fn setup_meilisearch(
|
||||
opt: &Opt,
|
||||
zookeeper: Option<Arc<ZooKeeper>>,
|
||||
zookeeper: Option<Arc<Zookeeper>>,
|
||||
) -> anyhow::Result<(Arc<IndexScheduler>, Arc<AuthController>)> {
|
||||
let empty_db = is_empty_db(&opt.db_path);
|
||||
let (index_scheduler, auth_controller) = if let Some(ref snapshot_path) = opt.import_snapshot {
|
||||
|
@ -219,7 +219,7 @@ pub async fn setup_meilisearch(
|
|||
fn open_or_create_database_unchecked(
|
||||
opt: &Opt,
|
||||
on_failure: OnFailure,
|
||||
zookeeper: Option<Arc<ZooKeeper>>,
|
||||
zookeeper: Option<Arc<Zookeeper>>,
|
||||
) -> anyhow::Result<(IndexScheduler, AuthController)> {
|
||||
// we don't want to create anything in the data.ms yet, thus we
|
||||
// wrap our two builders in a closure that'll be executed later.
|
||||
|
@ -278,7 +278,7 @@ fn open_or_create_database_unchecked(
|
|||
fn open_or_create_database(
|
||||
opt: &Opt,
|
||||
empty_db: bool,
|
||||
zookeeper: Option<Arc<ZooKeeper>>,
|
||||
zookeeper: Option<Arc<Zookeeper>>,
|
||||
) -> anyhow::Result<(IndexScheduler, AuthController)> {
|
||||
if !empty_db {
|
||||
check_version_file(&opt.db_path)?;
|
||||
|
|
|
@ -2,7 +2,6 @@ use std::env;
|
|||
use std::io::{stderr, Write};
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use actix_web::http::KeepAlive;
|
||||
use actix_web::web::Data;
|
||||
|
@ -13,7 +12,7 @@ use meilisearch::analytics::Analytics;
|
|||
use meilisearch::{analytics, create_app, prototype_name, setup_meilisearch, Opt};
|
||||
use meilisearch_auth::{generate_master_key, AuthController, MASTER_KEY_MIN_SIZE};
|
||||
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};
|
||||
use zookeeper::ZooKeeper;
|
||||
use zookeeper_client_sync::Zookeeper;
|
||||
|
||||
#[global_allocator]
|
||||
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
|
@ -65,9 +64,10 @@ async fn main() -> anyhow::Result<()> {
|
|||
_ => (),
|
||||
}
|
||||
|
||||
let timeout = Duration::from_millis(2500);
|
||||
let zookeeper =
|
||||
opt.zk_url.as_ref().map(|url| Arc::new(ZooKeeper::connect(url, timeout, drop).unwrap()));
|
||||
let zookeeper = match opt.zk_url {
|
||||
Some(ref url) => Some(Arc::new(Zookeeper::connect(url).await.unwrap())),
|
||||
None => None,
|
||||
};
|
||||
let (index_scheduler, auth_controller) = setup_meilisearch(&opt, zookeeper).await?;
|
||||
|
||||
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue