summaryrefslogtreecommitdiff
path: root/pkg/database/states.go
diff options
context:
space:
mode:
authorJulien Dessaux2024-10-18 00:01:50 +0200
committerJulien Dessaux2024-10-18 00:01:50 +0200
commit1ebf0341dd42fde631eb791358ef70a3331f92fe (patch)
treeeb646e3a828cc1e566f7085db38bad34a0f0e90d /pkg/database/states.go
parentfeat(tfstated): garbage collect older states (diff)
downloadtfstated-1ebf0341dd42fde631eb791358ef70a3331f92fe.tar.gz
tfstated-1ebf0341dd42fde631eb791358ef70a3331f92fe.tar.bz2
tfstated-1ebf0341dd42fde631eb791358ef70a3331f92fe.zip
feat(tfstated): allow configuration of version history limit via environment variable
Diffstat (limited to 'pkg/database/states.go')
-rw-r--r--pkg/database/states.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/database/states.go b/pkg/database/states.go
index 26a1021..5536533 100644
--- a/pkg/database/states.go
+++ b/pkg/database/states.go
@@ -102,7 +102,8 @@ func (db *DB) SetState(name string, data []byte, lockID string) (bool, error) {
JOIN states ON states.id = versions.state_id
WHERE states.name = :name
ORDER BY versions.id DESC
- LIMIT 64));`,
+ LIMIT :limit));`,
+ sql.Named("limit", db.versionsHistoryLimit),
sql.Named("name", name),
)
if err != nil {