fix(discord): always emit import error if it's of type error
We've been limiting the amount of errors being emitted to clients to reduce payload pressure and also due to the fact that we won't be rendering more than 3 error items in the UI. We want to let actual errors through (as opposed to warnings), even if the limit was reached.
This commit is contained in:
parent
bfab85f73b
commit
8ad9fb7713
|
@ -189,7 +189,7 @@ func (progress *ImportProgress) AddTaskError(task ImportTask, err *ImportError)
|
||||||
for i, t := range progress.Tasks {
|
for i, t := range progress.Tasks {
|
||||||
if t.Type == task.String() {
|
if t.Type == task.String() {
|
||||||
errorsAndWarningsCount := progress.Tasks[i].ErrorsCount + progress.Tasks[i].WarningsCount
|
errorsAndWarningsCount := progress.Tasks[i].ErrorsCount + progress.Tasks[i].WarningsCount
|
||||||
if errorsAndWarningsCount < MaxTaskErrorItemsCount {
|
if (errorsAndWarningsCount < MaxTaskErrorItemsCount) || err.Code > WarningType {
|
||||||
errors := progress.Tasks[i].Errors
|
errors := progress.Tasks[i].Errors
|
||||||
progress.Tasks[i].Errors = append(errors, err)
|
progress.Tasks[i].Errors = append(errors, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue