Skip to content

Commit 95043a3

Browse files
committed
Fix test
1 parent 9d5aa45 commit 95043a3

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

routers/api/v1/repo/main_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ func TestMain(m *testing.M) {
1717
setting.LoadForTest()
1818
unittest.MainTest(m, &unittest.TestOptions{
1919
GiteaRootPath: filepath.Join("..", "..", "..", ".."),
20-
SetUp: func() error {
21-
return webhook_service.Init()
22-
},
20+
SetUp: webhook_service.Init,
2321
})
2422
}

services/webhook/deliver.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,18 +203,14 @@ func Deliver(ctx context.Context, t *webhook_model.HookTask) error {
203203
}
204204

205205
// populateDeliverHooks checks and delivers undelivered hooks.
206-
// FIXME: graceful: This would likely benefit from either a worker pool with dummy queue
207-
// or a full queue. Then more hooks could be sent at same time.
208206
func populateDeliverHooks(ctx context.Context) {
209207
select {
210208
case <-ctx.Done():
211209
return
212210
default:
213211
}
214-
215212
ctx, _, finished := process.GetManager().AddTypedContext(ctx, "Service: DeliverHooks", process.SystemProcessType, true)
216213
defer finished()
217-
218214
tasks, err := webhook_model.FindUndeliveredHookTasks()
219215
if err != nil {
220216
log.Error("DeliverHooks: %v", err)

services/webhook/main_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@ import (
99
"testing"
1010

1111
"code.gitea.io/gitea/models/unittest"
12-
webhook_service "code.gitea.io/gitea/services/webhook"
1312

1413
_ "code.gitea.io/gitea/models"
1514
)
1615

1716
func TestMain(m *testing.M) {
1817
unittest.MainTest(m, &unittest.TestOptions{
1918
GiteaRootPath: filepath.Join("..", ".."),
20-
SetUp: func() error {
21-
return webhook_service.Init()
22-
},
19+
SetUp: Init,
2320
})
2421
}

0 commit comments

Comments
 (0)