-
Notifications
You must be signed in to change notification settings - Fork 4.4k
chore: fix console audits delete #9547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Security Scan Results for PRDocker Image Scan Results
Source Code Scan Results🎉 No vulnerabilities found! |
✨ Benchmark results
⚡ Benchmark Comparison
|
7f1f5b3
to
5eb7c36
Compare
53bcf9f
to
7c795da
Compare
@@ -389,6 +390,8 @@ services: | |||
- _APP_DATABASE_SHARED_TABLES | |||
- _APP_DATABASE_SHARED_TABLES_V1 | |||
- _APP_EMAIL_CERTIFICATES | |||
- _APP_MAINTENANCE_RETENTION_AUDIT | |||
- _APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only need to add this to the maintenance task and deletes worker right?
Server::setResource('auditRetention', function () { | ||
return DateTime::addSeconds(new \DateTime(), -1 8000 * System::getEnv('_APP_MAINTENANCE_RETENTION_AUDIT', 1209600)); | ||
return [ | ||
'project' => DateTime::addSeconds(new \DateTime(), -1 * System::getEnv('_APP_MAINTENANCE_RETENTION_AUDIT', 1209600)), // 14 days | ||
'console' => DateTime::addSeconds(new \DateTime(), -1 * System::getEnv('_APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE', 15778800)) // 6 months | ||
]; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the typical way we do this is to depend on the project? So if the project is console, it'd be one value. if the project is not, it would be another value. For example:
Lines 347 to 349 in 29ea03b
Server::setResource('deviceForFiles', function (Document $project) { | |
return getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId()); | |
}, ['project']); |
Also, this should probably depend on the org because the retention should really be different based on the plan.
What does this PR do?
Uses dbForPlatform for deleting console audits, and adds new retention for it. default is 6 months.
Test Plan
Related PRs and Issues
Checklist