mirror of
https://github.com/alireza0/s-ui.git
synced 2026-10-25 05:13:17 +00:00
fix backup
This commit is contained in:
parent
c97467da3c
commit
f4b1b09362
1 changed files with 8 additions and 4 deletions
|
|
@ -100,16 +100,20 @@ func GetDb(exclude string) ([]byte, error) {
|
|||
if err := db.Model(&model.Stats{}).Scan(&stats).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := backupDb.Save(stats).Error; err != nil {
|
||||
return nil, err
|
||||
if len(stats) > 0 {
|
||||
if err := backupDb.Save(stats).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
if !exclude_changes {
|
||||
if err := db.Model(&model.Changes{}).Scan(&changes).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := backupDb.Save(changes).Error; err != nil {
|
||||
return nil, err
|
||||
if len(changes) > 0 {
|
||||
if err := backupDb.Save(changes).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue