mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
perf(pr,issue): load the interactive create form data concurrently
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
7 files changed
+239
-38
No files matched your search
@@ -33,6 +33,11 @@ func pageOf[T any](items []T, limit, page int) ([]T, error) {
|
||||
return items[start:min(start+limit, len(items))], nil
|
||||
}
|
||||
|
||||
// loadTogether runs the loaders concurrently and returns their errors joined.
|
||||
func loadTogether(loaders ...func() error) error {
|
||||
return concurrently(len(loaders), func(i int) error { return loaders[i]() })
|
||||
}
|
||||
|
||||
// listAll collects pages until the server returns an empty one.
|
||||
func listAll[T any](fetch func(page int) ([]T, error)) ([]T, error) {
|
||||
result := []T{}
|
||||
|
||||
Reference in new issue
Block a user