mirror of
https://github.com/openai/codex.git
synced 2026-10-22 17:58:46 +00:00
fix: prune local security events
Co-authored-by: Codex noreply@openai.com
This commit is contained in:
co-authored by
Codex noreply@openai.com
parent
e97e2f88f2
commit
91c47c290b
@@ -101,6 +101,8 @@ pub use threads::ThreadFilterOptions;
|
||||
// metadata, rather than the exact sum of all persisted SQLite column bytes.
|
||||
const LOG_PARTITION_SIZE_LIMIT_BYTES: i64 = 10 * 1024 * 1024;
|
||||
const LOG_PARTITION_ROW_LIMIT: i64 = 1_000;
|
||||
const SECURITY_EVENT_RETENTION_DAYS: i64 = 10;
|
||||
const SECURITY_EVENT_PARTITION_ROW_LIMIT: i64 = 1_000;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
struct RuntimeDbSpec {
|
||||
@@ -309,6 +311,12 @@ impl StateRuntime {
|
||||
thread_updated_at_millis: Arc::new(AtomicI64::new(thread_updated_at_millis)),
|
||||
thread_recency_at_millis: Arc::new(AtomicI64::new(thread_recency_at_millis)),
|
||||
});
|
||||
if let Err(err) = runtime.run_security_events_startup_maintenance().await {
|
||||
warn!(
|
||||
"failed to run startup maintenance for state db at {}: {err}",
|
||||
state_path.display(),
|
||||
);
|
||||
}
|
||||
if let Err(err) = runtime.run_logs_startup_maintenance().await {
|
||||
warn!(
|
||||
"failed to run startup maintenance for logs db at {}: {err}",
|
||||
|
||||
Reference in New Issue
Block a user