2
0
mirror of https://github.com/carlostrub/sisyphus synced 2024-10-31 09:20:15 +00:00

perform backup first

This commit is contained in:
Carlo Strub 2017-12-29 22:04:48 +01:00
parent eaca7173f2
commit 7859b98d9c
No known key found for this signature in database
GPG Key ID: 34EF3FF33C29811A

View File

@ -159,8 +159,8 @@ COPYRIGHT:
log.Fatal("Cannot parse duration for learning intervals.")
}
learn(maildirs, dbs)
backup(maildirs, dbs)
learn(maildirs, dbs)
time.Sleep(duration)
}
}()
@ -267,7 +267,7 @@ func backup(maildirs []sisyphus.Maildir, dbs map[sisyphus.Maildir]*bolt.DB) {
w := bufio.NewWriter(backup)
err := db.View(func(tx *bolt.Tx) error {
err = db.View(func(tx *bolt.Tx) error {
_, err := tx.WriteTo(w)
return err
})