fix(katana): improve the image analyzing process

Zamn, decreasing contrast and also copying Nori code.
This commit is contained in:
2024-01-10 01:24:22 +07:00
parent 1b943f5698
commit 6f35d05a3e
6 changed files with 79 additions and 43 deletions

View File

@ -1,12 +1,12 @@
use crate::database;
use crate::structs::Character;
use mongodb::Collection;
use std::sync::OnceLock;
use std::time::{SystemTime, UNIX_EPOCH};
use tokio::sync::OnceCell;
use tokio::task;
use tracing::trace;
pub static KATANA: OnceLock<Collection<Character>> = OnceLock::new();
pub static KATANA: OnceCell<Collection<Character>> = OnceCell::const_new();
///
/// Initialize the "katana" collection in MongoDB

View File

@ -4,11 +4,11 @@ use mongodb::bson::doc;
use mongodb::options::ClientOptions;
use mongodb::{Client, Database};
use std::env;
use std::sync::OnceLock;
use tokio::sync::OnceCell;
use tracing::info;
static MONGO_CLIENT: OnceLock<Client> = OnceLock::new();
static MONGO_DATABASE: OnceLock<Database> = OnceLock::new();
static MONGO_CLIENT: OnceCell<Client> = OnceCell::const_new();
static MONGO_DATABASE: OnceCell<Database> = OnceCell::const_new();
pub async fn init() {
let mut options =