Skip to content

Commit af2e2d7

Browse files
committed
Missing defer of the progress bar closing.
This potentially led to states in which old progress bars were always showing up in the logs.
1 parent 25aaa92 commit af2e2d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/database/mariadb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ func (m *MariaDB) removeRelations(sourceID int, relations []knowledge.Relation)
324324
return 0, 0, err
325325
}
326326
bar := pb.StartNew(len(relations))
327+
defer bar.Finish()
327328
removedCount := int64(0)
328329

329330
stmt, err := tx.PrepareContext(context.Background(), `
@@ -352,7 +353,6 @@ WHERE a.type = ? AND a.value = ? AND b.type = ? AND b.value = ? AND r.type = ? A
352353
}
353354
removedCount += rCount
354355
}
355-
bar.Finish()
356356

357357
res, err := tx.ExecContext(context.Background(), `
358358
DELETE a FROM assets a

0 commit comments

Comments
 (0)