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
|
|
@ -557,7 +557,9 @@ async fn main() -> Result<()> {
|
|||
.await;
|
||||
},
|
||||
JobKind::CleanupAnalytics => {
|
||||
let before = chrono::Utc::now() - chrono::Duration::days(90);
|
||||
let retention_days = config.analytics.retention_days;
|
||||
let before = chrono::Utc::now()
|
||||
- chrono::Duration::days(retention_days as i64);
|
||||
match storage.cleanup_old_events(before).await {
|
||||
Ok(count) => {
|
||||
JobQueue::complete(
|
||||
|
|
@ -712,6 +714,9 @@ async fn main() -> Result<()> {
|
|||
transcode_service,
|
||||
managed_storage,
|
||||
chunked_upload_manager,
|
||||
session_semaphore: std::sync::Arc::new(tokio::sync::Semaphore::new(
|
||||
pinakes_server::state::MAX_SESSION_BACKGROUND_TASKS,
|
||||
)),
|
||||
};
|
||||
|
||||
// Periodic session cleanup (every 15 minutes)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue