File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,8 @@ func main() {
257
257
log .Fatal ("failed to recalculate contract account funding" , zap .Error (err ))
258
258
} else if err := db .CheckContractAccountFunding (); err != nil {
259
259
log .Fatal ("failed to check contract account funding" , zap .Error (err ))
260
+ } else if err := db .Vacuum (); err != nil {
261
+ log .Fatal ("failed to vacuum database" , zap .Error (err ))
260
262
}
261
263
return
262
264
}
Original file line number Diff line number Diff line change @@ -80,14 +80,23 @@ func recalcContractAccountFunding(tx txn, _ *zap.Logger) error {
80
80
return nil
81
81
}
82
82
83
+ // CheckContractAccountFunding checks that the contract account funding table
84
+ // is correct.
83
85
func (s * Store ) CheckContractAccountFunding () error {
84
86
return s .transaction (func (tx txn ) error {
85
87
return checkContractAccountFunding (tx , s .log )
86
88
})
87
89
}
88
90
91
+ // RecalcContractAccountFunding recalculates the contract account funding table.
89
92
func (s * Store ) RecalcContractAccountFunding () error {
90
93
return s .transaction (func (tx txn ) error {
91
94
return recalcContractAccountFunding (tx , s .log )
92
95
})
93
96
}
97
+
98
+ // Vacuum runs the VACUUM command on the database.
99
+ func (s * Store ) Vacuum () error {
100
+ _ , err := s .db .Exec (`VACUUM` )
101
+ return err
102
+ }
You can’t perform that action at this time.
0 commit comments