save tracks
All checks were successful
tests / fmt (push) Successful in 48s
tests / clippy (push) Successful in 1m14s
tests / pre-commit (push) Successful in 1m21s
tests / test (push) Successful in 1m32s
tests / build (push) Successful in 1m48s
deploy / release-image (push) Successful in 4m45s

This commit is contained in:
2024-06-27 22:41:53 +02:00
parent 3242f23f84
commit 7edd14c628
5 changed files with 75 additions and 11 deletions

View File

@@ -16,7 +16,7 @@ use futures::StreamExt;
use signal::signal_handler;
use songbird::{shards::TwilightMap, Songbird};
use state::StateRef;
use std::{env, error::Error, sync::Arc};
use std::{env, error::Error, str::FromStr, sync::Arc};
use tokio::select;
use tracing::{debug, info};
use twilight_cache_inmemory::InMemoryCache;
@@ -41,9 +41,9 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
let (mut shards, state) = {
let db = env::var("DATABASE_URL").map_err(|_| "DATABASE_URL is not set")?;
let options = SqliteConnectOptions::new()
.create_if_missing(true)
.filename(&db);
let options = SqliteConnectOptions::from_str(&db)
.expect("could not create options")
.create_if_missing(true);
let pool = SqlitePoolOptions::new()
.max_connections(5)
.connect_with(options)