kill off dead result type

This commit is contained in:
Brandon Thomas committed 2024-08-25 21:18:42 -04:00
1 parent 6f0a97e362
commit a5f435ae71
38 files changed
+44 -31

No files matched your search

Generated
+7
View File
@@ -1454,6 +1454,7 @@ name = "container_common"
version = "0.0.1"
dependencies = [
"anyhow",
"errors",
"my-workspace-hack",
"once_cell",
"rand 0.8.5",
@@ -2863,6 +2864,7 @@ version = "0.0.1"
dependencies = [
"anyhow",
"container_common",
"errors",
"log",
"my-workspace-hack",
"subprocess_common",
@@ -5530,6 +5532,7 @@ version = "0.0.1"
dependencies = [
"anyhow",
"container_common",
"errors",
"my-workspace-hack",
"serde",
"serde_derive",
@@ -7757,6 +7760,7 @@ dependencies = [
"dotenv",
"easyenv",
"enums",
"errors",
"filesys",
"google_drive_common",
"hashing",
@@ -7788,6 +7792,7 @@ dependencies = [
"container_common",
"dotenv",
"easyenv",
"errors",
"filesys",
"hashing",
"hostname 0.4.0",
@@ -8081,6 +8086,7 @@ dependencies = [
"container_common",
"dotenv",
"easyenv",
"errors",
"filesys",
"google_drive_common",
"hashing",
@@ -8111,6 +8117,7 @@ dependencies = [
"container_common",
"dotenv",
"easyenv",
"errors",
"filesys",
"google_drive_common",
"hostname 0.4.0",
@@ -18,6 +18,7 @@ normal = ["my-workspace-hack"]
[dependencies]
# Internal
errors = { path = "../../errors" }
container_common = { path = "../../deprecated/container_common" }
subprocess_common = { path = "../../subprocess_common" }
@@ -4,8 +4,8 @@ use anyhow::anyhow;
use log::info;
use tempdir::TempDir;
use container_common::anyhow_result::AnyhowResult;
use container_common::token::random_crockford_token::random_crockford_token;
use errors::AnyhowResult;
use subprocess_common::docker_options::DockerOptions;
/// This is a Python script that uses the `gdown` package to download from Google Drive.
@@ -16,6 +16,8 @@ path = "src/lib.rs"
normal = ["my-workspace-hack"]
[dependencies]
# Internal
errors = { path = "../../errors" }
# External
anyhow = "1.0.86"
@@ -1,2 +0,0 @@
/// Easier to import than anyhow::Result.
pub type AnyhowResult<T> = anyhow::Result<T>;
@@ -4,7 +4,7 @@ use std::path::Path;
use serde::de::DeserializeOwned;
use crate::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
/// Read a TOML file into a struct.
pub fn read_toml_file_to_struct<D, P>(filename: P) -> AnyhowResult<D>
@@ -1,4 +1,3 @@
pub mod anyhow_result;
pub mod files;
pub mod i18n;
pub mod numerics;
@@ -3,7 +3,7 @@ use std::time::{Duration, Instant};
use anyhow::anyhow;
use crate::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
/// Sometimes I need to kill a thread from somewhere else. This is a mechanism
/// that enables it. This utility can be combined with logic that will kill a
+1
View File
@@ -18,6 +18,7 @@ normal = ["my-workspace-hack"]
[dependencies]
# Internal
errors = { path = "../errors" }
container_common = { path = "../deprecated/container_common" }
# Workspace hack (faster compile times)
@@ -1,8 +1,8 @@
use anyhow::anyhow;
use container_common::anyhow_result::AnyhowResult;
use container_common::thread::thread_id::ThreadId;
use container_common::token::random_crockford_token::random_crockford_token;
use errors::AnyhowResult;
// TODO: Rename, document
@@ -1,7 +1,8 @@
use container_common::anyhow_result::AnyhowResult;
// TODO: Rename, document
use errors::AnyhowResult;
#[derive(Serialize, Deserialize, Debug)]
pub struct ObsActivePayload {
pub twitch_user_id: String,
@@ -3,7 +3,7 @@ use std::time::Duration;
use anyhow::anyhow;
use log::{error, warn};
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
use jobs_common::noop_logger::NoOpLogger;
use mysql_queries::queries::generic_download::job::list_available_generic_download_jobs::{AvailableDownloadJob, list_available_generic_download_jobs};
use mysql_queries::queries::generic_download::job::mark_generic_download_job_failure::mark_generic_download_job_failure;
@@ -5,7 +5,7 @@ use log::{info, warn};
use tempdir::TempDir;
use config::is_bad_download_url::is_bad_download_url;
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
use filesys::file_deletion::safe_delete_directory::safe_delete_directory;
use jobs_common::redis_job_status_logger::RedisJobStatusLogger;
use mysql_queries::queries::generic_download::job::list_available_generic_download_jobs::AvailableDownloadJob;
@@ -1,7 +1,7 @@
use tempdir::TempDir;
use container_common::anyhow_result::AnyhowResult;
use enums::by_table::generic_download_jobs::generic_download_type::GenericDownloadType;
use errors::AnyhowResult;
use jobs_common::redis_job_status_logger::RedisJobStatusLogger;
use mysql_queries::queries::generic_download::job::list_available_generic_download_jobs::AvailableDownloadJob;
@@ -3,7 +3,7 @@ use std::path::{Path, PathBuf};
use log::info;
use subprocess::{Popen, PopenConfig};
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
use filesys::path_to_string::path_to_string;
use subprocess_common::docker_options::DockerOptions;
@@ -4,7 +4,7 @@ use anyhow::anyhow;
use log::info;
use subprocess::{Popen, PopenConfig};
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
use filesys::path_to_string::path_to_string;
use subprocess_common::docker_options::{DockerFilesystemMount, DockerGpu, DockerOptions};
@@ -5,7 +5,7 @@ use anyhow::anyhow;
use log::info;
use subprocess::{Popen, PopenConfig};
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
use filesys::path_to_string::path_to_string;
use subprocess_common::docker_options::{DockerFilesystemMount, DockerGpu, DockerOptions};
@@ -23,6 +23,7 @@ config = { path = "../../../lib/deprecated/config" }
container_common = { path = "../../../lib/deprecated/container_common" }
easyenv = { path = "../../../lib/easyenv" }
enums = { path = "../../../_types/enums" }
errors = { path = "../../../lib/errors" }
filesys = { path = "../../../lib/files/filesys" }
google_drive_common = { path = "../../../lib/api_clients/google_drive_common" }
hashing = { path = "../../../lib/files/hashing" }
@@ -35,8 +35,8 @@ use config::bad_urls::is_bad_tts_model_download_url;
use config::common_env::CommonEnv;
use config::shared_constants::DEFAULT_MYSQL_CONNECTION_STRING;
use config::shared_constants::DEFAULT_RUST_LOG;
use container_common::anyhow_result::AnyhowResult;
use enums::by_table::tts_models::tts_model_type::TtsModelType;
use errors::AnyhowResult;
use filesys::check_directory_exists::check_directory_exists;
use filesys::check_file_exists::check_file_exists;
use filesys::file_deletion::safe_delete_directory::safe_delete_directory;
@@ -4,7 +4,7 @@ use std::path::Path;
use log::info;
use subprocess::{Popen, PopenConfig, Redirection};
use crate::AnyhowResult;
use errors::AnyhowResult;
/// This command is used to check tacotron for being a real model
#[derive(Clone)]
@@ -4,7 +4,7 @@ use std::path::Path;
use log::info;
use subprocess::{Popen, PopenConfig, Redirection};
use crate::AnyhowResult;
use errors::AnyhowResult;
/// This command is used to check talknet for being a real model
#[derive(Clone)]
@@ -23,6 +23,7 @@ collections = { path = "../../../lib/data/collections" }
config = { path = "../../../lib/deprecated/config" }
container_common = { path = "../../../lib/deprecated/container_common" }
easyenv = { path = "../../../lib/easyenv" }
errors = { path = "../../../lib/errors" }
filesys = { path = "../../../lib/files/filesys" }
hashing = { path = "../../../lib/files/hashing" }
jobs_common = { path = "../../../lib/jobs_common" }
@@ -2,7 +2,7 @@ use std::sync::{Arc, RwLock};
use anyhow::anyhow;
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
use crate::caching::cache_miss_strategizer::{CacheMissStrategizer, CacheMissStrategy};
@@ -4,7 +4,7 @@ use std::sync::{Arc, RwLock};
use anyhow::anyhow;
use lfu::LFUCache;
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
/// This stands in front of the python HTTP sidecar and controls which
/// models get to remain in memory. The Python sidecar keeps multiple
@@ -4,7 +4,7 @@ use anyhow::anyhow;
use log::info;
use reqwest::Client;
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
use mysql_queries::column_types::vocoder_type::VocoderType;
pub struct TtsInferenceSidecarClient {
@@ -3,7 +3,7 @@ use std::str::FromStr;
use log::info;
use reqwest::{Client, Url};
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
// TODO(bt): As more microservices adopt a common health check protocol,
// it may make sense to make this a common library.
@@ -12,7 +12,7 @@ use anyhow::anyhow;
use log::{error, info, warn};
use tempdir::TempDir;
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
use filesys::check_file_exists::check_file_exists;
use filesys::file_deletion::safe_delete_directory::safe_delete_directory;
use filesys::file_deletion::safe_delete_file::safe_delete_file;
@@ -31,7 +31,7 @@ use collections::multiple_random_from_vec::multiple_random_from_vec;
use config::common_env::CommonEnv;
use config::shared_constants::DEFAULT_MYSQL_CONNECTION_STRING;
use config::shared_constants::DEFAULT_RUST_LOG;
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
use filesys::check_directory_exists::check_directory_exists;
use jobs_common::job_progress_reporter::job_progress_reporter::JobProgressReporterBuilder;
use jobs_common::job_progress_reporter::noop_job_progress_reporter::NoOpJobProgressReporterBuilder;
@@ -23,6 +23,7 @@ cloud_storage = { path = "../../../lib/api_clients/cloud_storage" }
config = { path = "../../../lib/deprecated/config" }
container_common = { path = "../../../lib/deprecated/container_common" }
easyenv = { path = "../../../lib/easyenv" }
errors = { path = "../../../lib/errors" }
filesys = { path = "../../../lib/files/filesys" }
google_drive_common = { path = "../../../lib/api_clients/google_drive_common" }
hashing = { path = "../../../lib/files/hashing" }
@@ -34,7 +34,7 @@ use config::common_env::CommonEnv;
use config::is_bad_video_download_url::is_bad_video_download_url;
use config::shared_constants::DEFAULT_MYSQL_CONNECTION_STRING;
use config::shared_constants::DEFAULT_RUST_LOG;
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
use filesys::check_directory_exists::check_directory_exists;
use filesys::check_file_exists::check_file_exists;
use filesys::file_deletion::safe_delete_directory::safe_delete_directory;
@@ -3,7 +3,7 @@ use std::fs::OpenOptions;
use log::info;
use subprocess::{Popen, PopenConfig, Redirection};
use crate::AnyhowResult;
use errors::AnyhowResult;
/// This command is used to generate ffmpeg previews for videos.
#[derive(Clone)]
@@ -3,7 +3,7 @@ use std::fs::OpenOptions;
use log::info;
use subprocess::{Popen, PopenConfig, Redirection};
use crate::AnyhowResult;
use errors::AnyhowResult;
/// This command is used to generate ffmpeg previews for videos.
#[derive(Clone)]
@@ -3,7 +3,7 @@ use std::fs::OpenOptions;
use log::info;
use subprocess::{Popen, PopenConfig, Redirection};
use crate::AnyhowResult;
use errors::AnyhowResult;
/// This command is used to generate ffmpeg previews for videos.
#[derive(Clone)]
@@ -5,7 +5,7 @@ use std::fmt::Formatter;
use log::{info, warn};
use subprocess::{ExitStatus, Popen, PopenConfig};
use crate::AnyhowResult;
use errors::AnyhowResult;
/// The python script uses this exit code when face detection fails.
const FACE_DETECT_FAILURE_CODE : u32 = 5;
@@ -22,6 +22,7 @@ cloud_storage = { path = "../../../lib/api_clients/cloud_storage" }
config = { path = "../../../lib/deprecated/config" }
container_common = { path = "../../../lib/deprecated/container_common" }
easyenv = { path = "../../../lib/easyenv" }
errors = { path = "../../../lib/errors" }
filesys = { path = "../../../lib/files/filesys" }
google_drive_common = { path = "../../../lib/api_clients/google_drive_common" }
jobs_common = { path = "../../../lib/jobs_common" }
@@ -36,7 +36,7 @@ use cloud_storage::bucket_path_unifier::BucketPathUnifier;
use config::common_env::CommonEnv;
use config::shared_constants::DEFAULT_MYSQL_CONNECTION_STRING;
use config::shared_constants::DEFAULT_RUST_LOG;
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
use filesys::check_directory_exists::check_directory_exists;
use filesys::check_file_exists::check_file_exists;
use filesys::file_deletion::safe_delete_directory::safe_delete_directory;
@@ -4,7 +4,7 @@ use std::path::Path;
use log::info;
use subprocess::{Popen, PopenConfig, Redirection};
use crate::AnyhowResult;
use errors::AnyhowResult;
/// This command is used to run inference.
/// It uses preprocessed face files so that it's much faster.
@@ -1,7 +1,7 @@
use url::Url;
use buckets::public::media_files::bucket_file_path::MediaFileBucketPath;
use container_common::anyhow_result::AnyhowResult;
use errors::AnyhowResult;
pub fn bucket_url_from_media_path(
bucket_path: &MediaFileBucketPath,