Elizabeth Hunt
bef72712c2
All checks were successful
continuous-integration/drone/push Build is passing
18 lines
331 B
Go
18 lines
331 B
Go
package scheduler
|
|
|
|
import (
|
|
"database/sql"
|
|
"time"
|
|
|
|
"git.simponic.xyz/simponic/backup-notify/database"
|
|
"github.com/go-co-op/gocron"
|
|
)
|
|
|
|
func StartScheduler(dbConn *sql.DB) {
|
|
scheduler := gocron.NewScheduler(time.Local)
|
|
scheduler.Every(1).Hour().Do(func() {
|
|
database.DeleteOldBackups(dbConn, 31)
|
|
})
|
|
scheduler.StartAsync()
|
|
}
|