Commit ad93262
authored
fix(coderd/database/dbpurge): allow disabling AI Bridge retention with 0 (#21062)
Previously setting AI Bridge retention to 0 would cause records to be
deleted immediately since we didn't check for the zero value before
calculating the deletion threshold.
This adds a check for aibridgeRetention > 0 to skip deletion when
retention is disabled, matching the pattern used for other retention
settings (connection logs, audit logs, etc.).
Also fixes the return type of DeleteOldAIBridgeRecords from int32 to
int64 since COUNT(*) returns bigint in PostgreSQL.
Refs #210551 parent c750695 commit ad93262
File tree
9 files changed
+235
-162
lines changed- coderd/database
- dbauthz
- dbmetrics
- dbmock
- dbpurge
- queries
9 files changed
+235
-162
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
1735 | | - | |
| 1735 | + | |
1736 | 1736 | | |
1737 | 1737 | | |
1738 | 1738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4705 | 4705 | | |
4706 | 4706 | | |
4707 | 4707 | | |
4708 | | - | |
| 4708 | + | |
4709 | 4709 | | |
4710 | 4710 | | |
4711 | 4711 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
126 | 130 | | |
127 | 131 | | |
128 | 132 | | |
| |||
0 commit comments