1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(support): add db and activity db file size to support bundle [r8s-169] (#221)

This commit is contained in:
Malcolm Lockyer 2024-12-10 09:35:30 +13:00 committed by GitHub
parent aac9d001f7
commit 05e872337a
2 changed files with 10 additions and 0 deletions

View file

@ -62,6 +62,15 @@ func (connection *DbConnection) GetStorePath() string {
return connection.Path
}
func (connection *DbConnection) GetDatabaseFileSize() (int64, error) {
file, err := os.Stat(connection.GetDatabaseFilePath())
if err != nil {
return 0, fmt.Errorf("Failed to stat database file path: %s err: %w", connection.GetDatabaseFilePath(), err)
}
return file.Size(), nil
}
func (connection *DbConnection) SetEncrypted(flag bool) {
connection.isEncrypted = flag
}