Page MenuHomePhabricator

D9509.diff
No OneTemporary

D9509.diff

diff --git a/services/blob/src/config.rs b/services/blob/src/config.rs
--- a/services/blob/src/config.rs
+++ b/services/blob/src/config.rs
@@ -1,5 +1,5 @@
use anyhow::Result;
-use clap::Parser;
+use clap::{ArgAction, Parser};
use once_cell::sync::Lazy;
use tracing::info;
@@ -25,6 +25,10 @@
#[arg(long, default_value = "http://localhost:50054")]
pub identity_endpoint: String,
+ /// If set, blobs will be deleted instantly after revoking last holder
+ #[arg(long, global = true, action = ArgAction::SetTrue)]
+ pub instant_delete: bool,
+
#[clap(subcommand)]
pub command: Option<Command>,
}
diff --git a/services/blob/src/main.rs b/services/blob/src/main.rs
--- a/services/blob/src/main.rs
+++ b/services/blob/src/main.rs
@@ -34,8 +34,15 @@
let s3 = s3::S3Client::new(&aws_config);
let auth_service = AuthService::new(&aws_config, &config.identity_endpoint);
- let blob_service =
- service::BlobService::new(db, s3, BlobServiceConfig::default());
+ let blob_service = service::BlobService::new(
+ db,
+ s3,
+ BlobServiceConfig {
+ instant_delete_orphaned_blobs: config.instant_delete,
+ // orphan_protection_period: chrono::Duration::milliseconds(1),
+ ..Default::default()
+ },
+ );
match &config.command {
Some(Command::Cleanup) => blob_service.perform_cleanup().await?,

File Metadata

Mime Type
text/plain
Expires
Sun, Sep 29, 12:18 AM (8 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2198393
Default Alt Text
D9509.diff (1 KB)

Event Timeline