mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-11 20:32:12 +00:00
start using container shared lib
This commit is contained in:
1 parent
380b5d62a3
commit
a6855f5b80
56 files changed
+64
-67
No files matched your search
Generated
+1
@@ -3976,6 +3976,7 @@ dependencies = [
|
||||
"bcrypt",
|
||||
"chrono",
|
||||
"config",
|
||||
"container_common",
|
||||
"data-encoding",
|
||||
"derive_more",
|
||||
"diesel",
|
||||
|
||||
@@ -39,6 +39,7 @@ path = "src/w2l_inference_job.rs"
|
||||
|
||||
# Internal
|
||||
config = { path = "../../lib/config" }
|
||||
container_common = { path = "../../lib/container_common" }
|
||||
http_server_common = { path = "../../lib/http_server_common" }
|
||||
|
||||
# External
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use config::shared_constants::DEFAULT_REDIS_CONNECTION_STRING;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
|
||||
// TODO: Move more shared configs here.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! These are columns where users can control the visibility of their data.
|
||||
|
||||
use anyhow::anyhow;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
|
||||
/// To use this in a query, the query must have type annotations.
|
||||
/// See: https://www.gitmemory.com/issue/launchbadge/sqlx/1241/847154375
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! These denote the TTS synthesizer model types
|
||||
|
||||
use anyhow::anyhow;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Serialize, Deserialize, sqlx::Type)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! These denote the pretrained vocoders
|
||||
|
||||
use anyhow::anyhow;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Serialize, Deserialize, sqlx::Type)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::util::random_prefix_crockford_token::random_prefix_crockford_token;
|
||||
|
||||
/// Central place to define all the token types.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use anyhow::anyhow;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::helpers::tokens::Tokens;
|
||||
use crate::database::mediators::firehose_publisher::FirehosePublisher;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use crate::util::random_prefix_crockford_token::random_prefix_crockford_token;
|
||||
use log::{warn,info};
|
||||
use sqlx::error::Error::Database;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use anyhow::anyhow;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::helpers::tokens::Tokens;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use crate::util::random_prefix_crockford_token::random_prefix_crockford_token;
|
||||
use log::{warn,info};
|
||||
use sqlx::error::Error::Database;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
use anyhow::anyhow;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use log::warn;
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
use anyhow::anyhow;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use log::warn;
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
use anyhow::anyhow;
|
||||
use chrono::{DateTime, Utc};
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use log::warn;
|
||||
use sqlx::MySqlPool;
|
||||
use std::collections::{HashSet, HashMap};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
pub async fn delete_tts_model_as_user(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
pub async fn delete_tts_inference_result_as_user(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
pub async fn delete_w2l_inference_result_as_user(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
pub async fn delete_w2l_template_as_user(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use anyhow::anyhow;
|
||||
use chrono::{DateTime, Utc};
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use log::warn;
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use anyhow::anyhow;
|
||||
use chrono::{DateTime, Utc};
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::helpers::boolean_converters::i8_to_bool;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use log::{warn, info};
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use anyhow::anyhow;
|
||||
use chrono::{DateTime, Utc};
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use log::{warn, info};
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use anyhow::anyhow;
|
||||
use chrono::{DateTime, Utc};
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::helpers::boolean_converters::{nullable_i8_to_optional_bool, i8_to_bool};
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use log::{warn, info};
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use anyhow::anyhow;
|
||||
use chrono::{DateTime, Utc};
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::helpers::boolean_converters::nullable_i8_to_optional_bool;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use log::{warn, info};
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
use anyhow::anyhow;
|
||||
use chrono::{DateTime, Utc};
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::enums::record_visibility::RecordVisibility;
|
||||
use crate::database::helpers::boolean_converters::{i8_to_bool, nullable_i8_to_optional_bool};
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use log::{warn, info};
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
use anyhow::anyhow;
|
||||
use chrono::{DateTime, Utc};
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::enums::record_visibility::RecordVisibility;
|
||||
use crate::database::helpers::boolean_converters::{i8_to_bool, nullable_i8_to_optional_bool};
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use log::{warn, info};
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
use anyhow::anyhow;
|
||||
use chrono::{DateTime, Utc};
|
||||
use config::shared_constants::DEFAULT_MYSQL_QUERY_RESULT_PAGE_SIZE;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::enums::record_visibility::RecordVisibility;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use log::{warn, info};
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::helpers::boolean_converters::i8_to_bool;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
/// NB: This is not to be shared externally.
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
use anyhow::anyhow;
|
||||
use chrono::{DateTime, Utc};
|
||||
use config::shared_constants::DEFAULT_MYSQL_QUERY_RESULT_PAGE_SIZE;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::enums::record_visibility::RecordVisibility;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use log::{warn, info};
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use actix_web::http::header;
|
||||
use anyhow::anyhow;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::enums::vocoder_type::VocoderType;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use hyper::client::Client;
|
||||
use hyper::{Body, Request};
|
||||
use log::info;
|
||||
|
||||
@@ -5,12 +5,12 @@ use actix_web::error::ResponseError;
|
||||
use actix_web::http::StatusCode;
|
||||
use actix_web::{Responder, web, HttpResponse, error, HttpRequest, HttpMessage};
|
||||
use chrono::{DateTime, Utc};
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::queries::categories::list_tts_model_category_assignments::fetch_tts_model_category_map;
|
||||
use crate::database::queries::list_tts_models::list_tts_models;
|
||||
use crate::http_server::web_utils::ip_address::get_request_ip;
|
||||
use crate::http_server::web_utils::response_error_helpers::to_simple_json_error;
|
||||
use crate::server_state::ServerState;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use log::{info, warn, log, error};
|
||||
use regex::Regex;
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
+1
-1
@@ -7,6 +7,7 @@ use actix_web::http::header::ContentDisposition;
|
||||
use actix_web::web::{Data, Json, BytesMut};
|
||||
use actix_web::{middleware, web, App, Error, HttpResponse, HttpServer, HttpRequest, Either, ResponseError};
|
||||
use anyhow::anyhow;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::enums::record_visibility::RecordVisibility;
|
||||
use crate::database::helpers::tokens::Tokens;
|
||||
use crate::http_server::web_utils::ip_address::get_request_ip;
|
||||
@@ -16,7 +17,6 @@ use crate::http_server::web_utils::read_multipart_field_bytes::read_multipart_fi
|
||||
use crate::http_server::web_utils::read_multipart_field_bytes::read_multipart_field_bytes;
|
||||
use crate::http_server::web_utils::response_error_helpers::to_simple_json_error;
|
||||
use crate::server_state::ServerState;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use crate::util::buckets::bucket_client::BucketClient;
|
||||
use crate::util::buckets::bucket_paths::hash_to_bucket_path;
|
||||
use crate::util::random_crockford_token::random_crockford_token;
|
||||
|
||||
@@ -2,7 +2,7 @@ use actix_http::http::HeaderMap;
|
||||
use actix_http::http::HeaderName;
|
||||
use actix_web::HttpRequest;
|
||||
use actix_web::http::HeaderValue;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
|
||||
// NB: This is extracted because CLion is having incredible difficulty with these types.
|
||||
pub fn get_host_header(http_request: &HttpRequest) -> AnyhowResult<Option<String>> {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
use anyhow::anyhow;
|
||||
use chrono::Utc;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::helpers::tokens::Tokens;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use crate::util::random_crockford_token::random_crockford_token;
|
||||
use crate::util::random_prefix_crockford_token::random_prefix_crockford_token;
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
use anyhow::anyhow;
|
||||
use chrono::{Utc, DateTime};
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::enums::record_visibility::RecordVisibility;
|
||||
use crate::database::enums::vocoder_type::VocoderType;
|
||||
use crate::database::helpers::tokens::Tokens;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use crate::util::random_prefix_crockford_token::random_prefix_crockford_token;
|
||||
use log::{warn, info};
|
||||
use sqlx::{MySqlPool, Transaction, MySql};
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
use anyhow::anyhow;
|
||||
use chrono::Utc;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::helpers::tokens::Tokens;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use crate::util::random_crockford_token::random_crockford_token;
|
||||
use crate::util::random_prefix_crockford_token::random_prefix_crockford_token;
|
||||
use sqlx::MySqlPool;
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
use anyhow::anyhow;
|
||||
use chrono::{Utc, DateTime};
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::enums::record_visibility::RecordVisibility;
|
||||
use crate::database::helpers::tokens::Tokens;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use crate::util::random_crockford_token::random_crockford_token;
|
||||
use crate::util::random_prefix_crockford_token::random_prefix_crockford_token;
|
||||
use log::{warn, info};
|
||||
|
||||
@@ -35,6 +35,7 @@ use actix_web::{HttpServer, web, HttpResponse, App};
|
||||
use config::shared_constants::DEFAULT_MYSQL_CONNECTION_STRING;
|
||||
use config::shared_constants::DEFAULT_REDIS_CONNECTION_STRING;
|
||||
use config::shared_constants::DEFAULT_RUST_LOG;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::database::mediators::badge_granter::BadgeGranter;
|
||||
use crate::database::mediators::firehose_publisher::FirehosePublisher;
|
||||
use crate::http_server::endpoints::events::list_events::list_events_handler;
|
||||
@@ -146,8 +147,6 @@ const ENV_PUBLIC_BUCKET_NAME : &'static str = "W2L_PUBLIC_DOWNLOAD_BUCKET_NAME";
|
||||
// Various bucket roots
|
||||
const ENV_AUDIO_UPLOADS_BUCKET_ROOT : &'static str = "AUDIO_UPLOADS_BUCKET_ROOT";
|
||||
|
||||
pub type AnyhowResult<T> = anyhow::Result<T>;
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> AnyhowResult<()> {
|
||||
easyenv::init_all_with_default_logging(Some(DEFAULT_RUST_LOG));
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
use anyhow::anyhow;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::util::random_crockford_token::random_crockford_token;
|
||||
use log::{info, warn};
|
||||
use std::io::{BufReader, Read};
|
||||
|
||||
@@ -20,6 +20,7 @@ use anyhow::anyhow;
|
||||
use chrono::Utc;
|
||||
use config::shared_constants::DEFAULT_MYSQL_CONNECTION_STRING;
|
||||
use config::shared_constants::DEFAULT_RUST_LOG;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::common_env::CommonEnv;
|
||||
use crate::database::enums::tts_model_type::TtsModelType;
|
||||
use crate::database::mediators::badge_granter::BadgeGranter;
|
||||
@@ -33,7 +34,6 @@ use crate::job_queries::tts_download_job_queries::query_tts_upload_job_records;
|
||||
use crate::script_execution::google_drive_download_command::GoogleDriveDownloadCommand;
|
||||
use crate::script_execution::tacotron_model_check_command::TacotronModelCheckCommand;
|
||||
use crate::script_execution::talknet_model_check_command::TalknetModelCheckCommand;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use crate::util::buckets::bucket_client::BucketClient;
|
||||
use crate::util::buckets::bucket_path_unifier::BucketPathUnifier;
|
||||
use crate::util::buckets::bucket_paths::hash_to_bucket_path;
|
||||
|
||||
@@ -21,6 +21,7 @@ use anyhow::{anyhow, Error};
|
||||
use chrono::{Utc, DateTime, TimeZone};
|
||||
use config::shared_constants::DEFAULT_MYSQL_CONNECTION_STRING;
|
||||
use config::shared_constants::DEFAULT_RUST_LOG;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::common_env::CommonEnv;
|
||||
use crate::database::enums::vocoder_type::VocoderType;
|
||||
use crate::database::mediators::firehose_publisher::FirehosePublisher;
|
||||
@@ -36,7 +37,6 @@ use crate::job_queries::tts_inference_job_queries::mark_tts_inference_job_failur
|
||||
use crate::job_queries::tts_inference_job_queries::mark_tts_inference_job_permanently_dead;
|
||||
use crate::job_queries::tts_inference_job_queries::query_tts_inference_job_records;
|
||||
use crate::script_execution::tacotron_inference_command::TacotronInferenceCommand;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use crate::util::buckets::bucket_client::BucketClient;
|
||||
use crate::util::buckets::bucket_path_unifier::BucketPathUnifier;
|
||||
use crate::util::buckets::bucket_paths::hash_to_bucket_path;
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/// Easier to import than anyhow::Result.
|
||||
pub type AnyhowResult<T> = anyhow::Result<T>;
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::util::buckets::bucket_paths::hash_to_bucket_path;
|
||||
use std::path::PathBuf;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use anyhow::anyhow;
|
||||
use anyhow::bail;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub fn hash_to_bucket_path(file_hash: &str,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use anyhow::bail;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use lru_time_cache::LruCache;
|
||||
use std::sync::{Arc, Mutex, PoisonError, MutexGuard};
|
||||
use std::time::Duration;
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
|
||||
use base64;
|
||||
use magic_crypt::{MagicCryptTrait, MagicCrypt256};
|
||||
use magic_crypt::generic_array::typenum::U256;
|
||||
use std::io::Cursor;
|
||||
use magic_crypt::new_magic_crypt;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use rand::RngCore;
|
||||
use base64::{Config, CharacterSet};
|
||||
use base64;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use magic_crypt::generic_array::typenum::U256;
|
||||
use magic_crypt::new_magic_crypt;
|
||||
use magic_crypt::{MagicCryptTrait, MagicCrypt256};
|
||||
use rand::RngCore;
|
||||
use std::io::Cursor;
|
||||
|
||||
// TODO: A protobuf would be more compact!
|
||||
/// This gets encrypted and sent to the frontend as an opaque handle.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use anyhow::bail;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use log::info;
|
||||
use log::warn;
|
||||
use std::fs;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::util::hashing::sha256_digest::sha256_digest;
|
||||
use data_encoding::HEXLOWER_PERMISSIVE;
|
||||
use ring::digest::{Context, Digest, SHA256};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::util::hashing::sha256_digest::sha256_digest;
|
||||
use data_encoding::HEXLOWER_PERMISSIVE;
|
||||
use ring::digest::{Context, Digest, SHA256};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use data_encoding::HEXLOWER_PERMISSIVE;
|
||||
use ring::digest::{Context, Digest, SHA256};
|
||||
use std::fs::File;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use anyhow::anyhow;
|
||||
use chrono::{DateTime, Utc, Duration};
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::util::jobs::cache_miss_strategizer::{CacheMissStrategizer, CacheMissStrategy};
|
||||
use std::sync::{RwLock, Arc};
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use anyhow::anyhow;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use lfu::LFUCache;
|
||||
use std::sync::{Arc, RwLock};
|
||||
use std::collections::HashSet;
|
||||
use std::borrow::Borrow;
|
||||
use std::collections::HashSet;
|
||||
use std::sync::{Arc, RwLock};
|
||||
|
||||
/// This stands in front of the python HTTP sidecar and controls which
|
||||
/// models get to remain in memory. The Python sidecar keeps multiple
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use pulldown_cmark::{Options, Parser, html};
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
|
||||
pub fn markdown_to_html(markdown_input: &str) -> String {
|
||||
// NB: CommonMark allows for HTML, including <script>! WTF!
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
pub mod anyhow_result;
|
||||
pub mod buckets;
|
||||
pub mod caching;
|
||||
pub mod delete_role_disambiguation;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use rand::Rng;
|
||||
use anyhow::anyhow;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use rand::Rng;
|
||||
|
||||
// Crockford characters
|
||||
const CROCKFORD_UPPERCASE_CHARSET: &[u8] = b"0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::util::redis::redis_keys::RedisKeys;
|
||||
use r2d2_redis::RedisConnectionManager;
|
||||
use r2d2_redis::r2d2::PooledConnection;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::path::{PathBuf, Path};
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use std::fs;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use std::path::{PathBuf, Path};
|
||||
use tempdir::TempDir;
|
||||
|
||||
/// These are for files on the worker filesystems
|
||||
|
||||
@@ -20,6 +20,7 @@ use anyhow::{anyhow, Error};
|
||||
use chrono::Utc;
|
||||
use config::shared_constants::DEFAULT_MYSQL_CONNECTION_STRING;
|
||||
use config::shared_constants::DEFAULT_RUST_LOG;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::common_env::CommonEnv;
|
||||
use crate::database::mediators::badge_granter::BadgeGranter;
|
||||
use crate::database::mediators::firehose_publisher::FirehosePublisher;
|
||||
@@ -35,7 +36,6 @@ use crate::script_execution::ffmpeg_generate_preview_video_command::FfmpegGenera
|
||||
use crate::script_execution::google_drive_download_command::GoogleDriveDownloadCommand;
|
||||
use crate::script_execution::imagemagick_generate_preview_image_command::ImagemagickGeneratePreviewImageCommand;
|
||||
use crate::script_execution::wav2lip_process_upload_command::{Wav2LipPreprocessClient, Wav2LipPreprocessError};
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use crate::util::buckets::bucket_client::BucketClient;
|
||||
use crate::util::buckets::bucket_paths::hash_to_bucket_path;
|
||||
use crate::util::filesystem::check_directory_exists;
|
||||
|
||||
@@ -20,6 +20,7 @@ use anyhow::anyhow;
|
||||
use chrono::Utc;
|
||||
use config::shared_constants::DEFAULT_MYSQL_CONNECTION_STRING;
|
||||
use config::shared_constants::DEFAULT_RUST_LOG;
|
||||
use container_common::anyhow_result::AnyhowResult;
|
||||
use crate::common_env::CommonEnv;
|
||||
use crate::database::mediators::firehose_publisher::FirehosePublisher;
|
||||
use crate::job_queries::w2l_inference_job_queries::W2lInferenceJobRecord;
|
||||
@@ -34,7 +35,6 @@ use crate::script_execution::ffmpeg_generate_preview_video_command::FfmpegGenera
|
||||
use crate::script_execution::google_drive_download_command::GoogleDriveDownloadCommand;
|
||||
use crate::script_execution::imagemagick_generate_preview_image_command::ImagemagickGeneratePreviewImageCommand;
|
||||
use crate::script_execution::wav2lip_inference_command::Wav2LipInferenceCommand;
|
||||
use crate::util::anyhow_result::AnyhowResult;
|
||||
use crate::util::buckets::bucket_client::BucketClient;
|
||||
use crate::util::buckets::bucket_path_unifier::BucketPathUnifier;
|
||||
use crate::util::buckets::bucket_paths::hash_to_bucket_path;
|
||||
|
||||
Reference in new issue
Block a user