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:
parent
b24d4cbcdd
commit
01fc2021c0
6 changed files with 42 additions and 16 deletions
|
|
@ -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>,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue