Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-04-15 10:31:10 +03:00
коммит произвёл GitHub
родитель 282c2b94a9
Коммит 6ab7cd0f1a
6 изменённых файлов: 109 добавлений и 12 удалений

Просмотреть файл

@@ -416,3 +416,12 @@ func (ds *DatabaseStore) String() string {
func (ds *DatabaseStore) Close() error {
return ds.db.Close()
}
// removes configurations from database if they are older than threshold.
func (ds *DatabaseStore) cleanUp(thresholdCreatAt int) error {
if _, err := ds.db.NamedExec("DELETE FROM Configurations Where CreateAt < :timestamp", map[string]interface{}{"timestamp": thresholdCreatAt}); err != nil {
return errors.Wrap(err, "unable to clean Configurations table")
}
return nil
}