diff options
author | Julien Dessaux | 2024-10-18 00:01:50 +0200 |
---|---|---|
committer | Julien Dessaux | 2024-10-18 00:01:50 +0200 |
commit | 1ebf0341dd42fde631eb791358ef70a3331f92fe (patch) | |
tree | eb646e3a828cc1e566f7085db38bad34a0f0e90d /pkg/database/states.go | |
parent | feat(tfstated): garbage collect older states (diff) | |
download | tfstated-1ebf0341dd42fde631eb791358ef70a3331f92fe.tar.gz tfstated-1ebf0341dd42fde631eb791358ef70a3331f92fe.tar.bz2 tfstated-1ebf0341dd42fde631eb791358ef70a3331f92fe.zip |
feat(tfstated): allow configuration of version history limit via environment variable
Diffstat (limited to '')
-rw-r--r-- | pkg/database/states.go | 3 |
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 { |