feat(database): add a flag to compact on startup BE-12283 (#1255)

This commit is contained in:
andres-portainer
2025-09-24 18:44:09 -03:00
committed by GitHub
parent c8ee2ca4a1
commit b7384874cf
9 changed files with 142 additions and 10 deletions

View File

@@ -8,11 +8,12 @@ import (
)
// NewDatabase should use config options to return a connection to the requested database
func NewDatabase(storeType, storePath string, encryptionKey []byte) (connection portainer.Connection, err error) {
func NewDatabase(storeType, storePath string, encryptionKey []byte, compact bool) (connection portainer.Connection, err error) {
if storeType == "boltdb" {
return &boltdb.DbConnection{
Path: storePath,
EncryptionKey: encryptionKey,
Compact: compact,
}, nil
}