Skip to content

Commit df18dbb

Browse files
committed
feat: disable GC for orphaned packages by default
Downstream issue: https://issues.redhat.com/browse/TC-2958
1 parent ce1537c commit df18dbb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/env-vars.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
| `TRUSTD_DB_PASSWORD` | Database password | `trustify` |
4242
| `TRUSTD_DB_PORT` | Database port | `5432` |
4343
| `TRUSTD_DB_USER` | Database username | `postgres` |
44-
| `TRUSTD_GC_FREQ` | How often database garbage collection runs (humantime) | `1h` |
44+
| `TRUSTD_GC_FREQ` | Database garbage collection frequency [disabled by default] (humantime) | `0s` |
4545
| `TRUSTD_ISSUER_URL` | Issuer URL for `--devmode` | `http://localhost:8090/realms/trustify` |
4646
| `TRUSTD_MAX_CACHE_SIZE` | Maximum size of the graph cache. | `200 MiB` |
4747
| `TRUSTD_S3_ACCESS_KEY` | S3 access key | |

server/src/profile/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use trustify_module_storage::{
3838
use trustify_module_ui::{UI, endpoints::UiResources};
3939
use utoipa::openapi::{Info, License};
4040

41-
const GC_FREQ: Duration = Duration::from_secs(60 * 60);
41+
const GC_FREQ: Duration = Duration::from_secs(0);
4242
const ENV_GC_FREQ: &str = "TRUSTD_GC_FREQ";
4343

4444
/// Run the API server
@@ -379,7 +379,7 @@ fn schedule_db_tasks(db: db::Database) {
379379
_ => GC_FREQ,
380380
};
381381
if freq < Duration::from_secs(1) {
382-
log::warn!("GC is disabled; to enable, set {ENV_GC_FREQ} to at least 1s");
382+
log::warn!("Garbage collection is disabled; to enable, set {ENV_GC_FREQ} to at least 1s");
383383
return;
384384
}
385385
log::info!("GC frequency set to {}", humantime::Duration::from(freq));

0 commit comments

Comments
 (0)