mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-29 15:28:38 +00:00
Allow exit when caculating language in gogit version
This commit is contained in:
parent
57ba66822a
commit
9363b591ed
@ -59,6 +59,13 @@ func CalcLanguageStats(ctx context.Context, repo *git_module.Repository, commitI
|
||||
firstExcludedLanguageSize := int64(0)
|
||||
|
||||
err = tree.Files().ForEach(func(f *object.File) error {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
|
||||
if f.Size == 0 {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user