1
0
Fork 0

Fix task save query

This commit is contained in:
Gregory Eremin 2015-03-05 19:54:05 +07:00
parent db21c27b54
commit 7fc7b1889b
1 changed files with 10 additions and 3 deletions

View File

@ -2,8 +2,6 @@ package db
import (
"time"
"github.com/fatih/structs"
)
type (
@ -26,7 +24,16 @@ const (
)
func (t *Task) Save() {
if _, err := stmt(saveTaskQuery).Exec(structs.Values(t)); err != nil {
if _, err := stmt(saveTaskQuery).Exec(
t.Token, t.Owner,
t.Job, t.Worker,
t.Duration, t.Error,
t.CreatedAt, t.StartedAt,
); err != nil {
panic(err)
}
}
func (t *Task) T() *Task {
return t
}