Fix 500 server error on project dashboard by rmunn · Pull Request #1779 · sillsdev/web-languageforge
Large projects were returning an HTTP 500 on the project dashboard, because PHP was running out of memory trying to return every entry for stats to be calculated client-side. This changes the stats to be calculated server-side instead. We get rid of the "number of entries with audio" stat because it's not possible to calculate in a simple Mongo query and would require serializing the entire entry database server-side, causing the very memory error we're trying to get rid of.
Now the lex_stats call opens a single MongoDB connection and reuses it for all three queries. The efficiency boost might be minor, but it's also a slight code simplification so it's just as well to do it now.
rmunn
deleted the
bugfix/dashboard-500
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters