fix(be): checking error by nil before log it

This commit is contained in:
Denis Gukov 2021-08-31 03:15:00 +05:00
parent c1c8a9ebf9
commit ab098b8b82

View File

@ -88,12 +88,15 @@ func (p *taskPool) run() {
for {
select {
case record := <-p.logger:
err, _ := record.task.store.CreateTaskOutput(db.TaskOutput{
_, err := record.task.store.CreateTaskOutput(db.TaskOutput{
TaskID: record.task.task.ID,
Output: record.output,
Time: record.time,
})
log.Error(err)
if err != nil {
log.Error(err)
}
case task := <-p.register:
p.queue = append(p.queue, task)
log.Debug(task)