8000 For language detection do not try to analyze big files by content by lafriks · Pull Request #11971 · go-gitea/gitea · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

For language detection do not try to analyze big files by content #11971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2020

Conversation

lafriks
Copy link
Member
@lafriks lafriks commented Jun 19, 2020

Even when using Reader go-git will still load file content into memory. Limit language statistics to not analyze files larger than 1MiB. Also fix to read only 16KiB of file to pass to analyze, it was set to 16MiB by mistake 😈

Should fix #11969

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jun 19, 2020
@silverwind
Copy link
Member

Should probably make this configurable.

@lafriks
Copy link
Member Author
lafriks commented Jun 19, 2020

@silverwind that could be improved in other PR. Currently this is just bugfix

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 19, 2020
@lafriks
Copy link
Member Author
lafriks commented Jun 19, 2020

🚀

@lafriks lafriks merged commit 5389b6c into go-gitea:master Jun 19, 2020
@lafriks lafriks deleted the fix/langstat_big_files branch June 19, 2020 08:08
lafriks added a commit to lafriks-fork/gitea that referenced this pull request Jun 19, 2020
@lafriks lafriks added the backport/done All backports for this PR have been created label Jun 19, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fatal error: out of memory
5 participants
0