mirror of https://github.com/go-gitea/gitea.git
Warn instead of reporting an error when a webhook cannot be found (#26039)
Attemp fix: #25744 Fixing the log level when we delete any repo then we get error hook not found by id. That should be warn level to reduce the noise in the logs. --------- Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
parent
1d8d90fd37
commit
4971a10543
|
@ -5,6 +5,7 @@ package webhook
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -111,7 +112,11 @@ func handler(items ...int64) []int64 {
|
||||||
for _, taskID := range items {
|
for _, taskID := range items {
|
||||||
task, err := webhook_model.GetHookTaskByID(ctx, taskID)
|
task, err := webhook_model.GetHookTaskByID(ctx, taskID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if errors.Is(err, util.ErrNotExist) {
|
||||||
|
log.Warn("GetHookTaskByID[%d] warn: %v", taskID, err)
|
||||||
|
} else {
|
||||||
log.Error("GetHookTaskByID[%d] failed: %v", taskID, err)
|
log.Error("GetHookTaskByID[%d] failed: %v", taskID, err)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue