mirror of
https://github.com/go-gitea/gitea.git
synced 2025-09-17 18:18:01 +00:00
Allow exit when caculating language in gogit version
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user