Remove backup code from db package

This commit is contained in:
Tobie Morgan Hitchcock 2016-07-17 11:40:12 +01:00
parent a9bff47026
commit e85a6d86df

View file

@ -37,8 +37,6 @@ type Response struct {
}
var db *kvs.DB
var quit chan int
var tick *time.Ticker
// Setup sets up the connection with the data layer
func Setup(opts *cnf.Options) (err error) {
@ -47,8 +45,6 @@ func Setup(opts *cnf.Options) (err error) {
db, err = kvs.New(opts.DB.Path)
// backup(opts)
return
}
@ -58,8 +54,6 @@ func Exit() {
log.WithPrefix("db").Infof("Gracefully shutting down database")
// quit <- 0
db.Close()
}
@ -96,27 +90,6 @@ func Execute(ctx *fibre.Context, txt interface{}) (out []interface{}, err error)
}
func backup(opts *cnf.Options) {
/*tick = time.NewTicker(opts.Backups.Time)
quit = make(chan int)
go func() {
for {
select {
case <-tick.C:
t := time.Now().Format("2006-01-02T15-04-05")
n := fmt.Sprintf("%s.backup.db", t)
db.Save(n)
case <-quit:
tick.Stop()
return
}
}
}()*/
}
func status(e error) interface{} {
switch e.(type) {
default: