Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2831512
D9509.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9509.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D9509: [blob] Add CLI option to enable auto-deletion
Attached
Detach File
Event Timeline
Log In to Comment