pinakes-server: bound session concurrency; handle JoinError; make analytics

retention configurable

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iaa35af821862eeadba0a4f384b2aec2c6a6a6964
This commit is contained in:
raf 2026-03-07 16:55:43 +03:00
commit 01fc2021c0
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
6 changed files with 42 additions and 16 deletions

View file

@ -12,11 +12,15 @@ use pinakes_core::{
sync::ChunkedUploadManager,
transcode::TranscodeService,
};
use tokio::sync::RwLock;
use tokio::sync::{RwLock, Semaphore};
// Note: Sessions are now stored in the database via StorageBackend
// See storage::SessionData and related methods
/// Max concurrent background session operations (touch/delete).
/// Prevents unbounded task spawning under high request load.
pub const MAX_SESSION_BACKGROUND_TASKS: usize = 64;
#[derive(Clone)]
pub struct AppState {
pub storage: DynStorageBackend,
@ -30,4 +34,5 @@ pub struct AppState {
pub transcode_service: Option<Arc<TranscodeService>>,
pub managed_storage: Option<Arc<ManagedStorageService>>,
pub chunked_upload_manager: Option<Arc<ChunkedUploadManager>>,
pub session_semaphore: Arc<Semaphore>,
}