Skip to content

Commit

Permalink
Merge (with fixes) pull request #168 from madiele/dependabot/cargo/ru…
Browse files Browse the repository at this point in the history
…st-dependencies-c27f022494

Bump the rust-dependencies group with 2 updates
  • Loading branch information
madiele committed May 5, 2024
2 parents 39cbd56 + 4751f8c commit fda8647
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"image": "mcr.microsoft.com/devcontainers/rust:latest",
"postCreateCommand": "./.devcontainer/PostCreateScript.sh",
"postStartCommand": "make start-deps",
"customizations": {
Expand All @@ -10,5 +10,8 @@
"ms-azuretools.vscode-docker"
]
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": "latest"
}
}
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ futures = "=0.3.30"
log = "=0.4.21"
regex = "=1.10.4"
reqwest = { version = "=0.12.4", features = ["json"] }
serde = "=1.0.198"
serde = "=1.0.199"
serde_json = "=1.0.116"
tokio = { version = "=1.37.0", features = ["macros", "process"]}
uuid = { version= "=1.8.0", features = ["v4", "serde"]}
Expand All @@ -32,7 +32,7 @@ eyre = "=0.6"
simple_logger = "=4.3"
redis = { version = "=0.25", features = ["tokio-comp"] }
mime = "=0.3.17"
cached = { version = "=0.49.3", features = ["redis_tokio"] }
cached = { version = "=0.50.0", features = ["redis_tokio"] }
iso8601-duration = "=0.2.0"
chrono = "=0.4.38"
feed-rs = "=1.4.0"
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ pub mod rss_transcodizer;
pub mod server;
pub mod transcoder;

pub async fn get_redis_client() -> Result<redis::aio::Connection, eyre::Error> {
pub async fn get_redis_client() -> Result<redis::aio::MultiplexedConnection, eyre::Error> {
let redis_address = conf().get(ConfName::RedisAddress).unwrap();
let redis_port = conf().get(ConfName::RedisPort).unwrap();
let client = redis::Client::open(format!("redis://{}:{}/", redis_address, redis_port))?;
let con = client.get_tokio_connection().await?;
let con = client.get_multiplexed_tokio_connection().await?;
Ok(con)
}

8 changes: 4 additions & 4 deletions src/provider/youtube.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ struct VideoExtraInfo {
}

async fn create_duration_url_map(
items: &Vec<PlaylistItem>,
items: &[PlaylistItem],
api_key: &str,
) -> Result<HashMap<String, VideoExtraInfo>, eyre::Error> {
let ids_batches = items.chunks(50).map(|c| {
Expand Down Expand Up @@ -467,7 +467,7 @@ fn get_youtube_hub() -> YouTube<hyper_rustls::HttpsConnector<hyper::client::Http

#[io_cached(
map_error = r##"|e| eyre::Error::new(e)"##,
type = "AsyncRedisCache<Url, Url>",
ty = "AsyncRedisCache<Url, Url>",
create = r##" {
AsyncRedisCache::new("cached_yt_stream_url=", 18000)
.set_refresh(false)
Expand Down Expand Up @@ -543,7 +543,7 @@ async fn feed_url_for_yt_channel(url: &Url) -> eyre::Result<Url> {
not(test),
io_cached(
map_error = r##"|e| eyre::Error::new(e)"##,
type = "AsyncRedisCache<Url, Url>",
ty = "AsyncRedisCache<Url, Url>",
create = r##" {
AsyncRedisCache::new("youtube_channel_username_to_id=", 9999999)
.set_refresh(false)
Expand Down Expand Up @@ -627,7 +627,7 @@ fn convert_atom_to_rss(feed: Feed, duration_map: HashMap<String, Option<usize>>)
not(test),
io_cached(
map_error = r##"|e| eyre::Error::new(e)"##,
type = "AsyncRedisCache<Url, Option<usize>>",
ty = "AsyncRedisCache<Url, Option<usize>>",
create = r##" {
AsyncRedisCache::new("cached_yt_video_duration=", 86400)
.set_refresh(false)
Expand Down

0 comments on commit fda8647

Please sign in to comment.