Defer query to mark task as completed

This commit is contained in:
Dustin Pianalto 2020-05-01 00:25:42 -08:00
parent 4fe8419914
commit 6bdd4a0665

View File

@ -19,6 +19,8 @@ type Task struct {
}
func processTask(task *Task, s *discordgo.Session) {
closeQuery := "Update tasks set completed = true where id = $1"
defer Database.Exec(closeQuery, task.ID)
log.Println(fmt.Sprintf("Processing task %v", task.ID))
guild, err := s.Guild(task.GuildID)
if err != nil {