mirror of
https://github.com/wallabag/wallabag.git
synced 2024-09-27 14:00:15 +00:00
19802d8bd5
I've noticed that the endpoint `/api/entries/exists` used by the "Sweep articles" feature on the Android app failed almost all the time on my instance. After checking the corresponding method I found that `EntryRestController::getEntriesExistsAction()` could be improved. Here is the former way the method worked: ``` for id in [list of ids] get full entry by id if null get full entry by given id return array of ids or array of hashes ``` With this behavior on my instance I could expect up to 13k SQL requests when sweeping articles from the Android app. Morever the repository fetches all fields (content included) while the method only returns ids or hashes. The new behavior is described as follow: ``` get ids, hashes by [list of ids] merge with provided [list of ids] // this part will complete the final // array with not found ids return array of ids or array of hashes ``` In my case this change reduces the number of SQL requests to only 135 (_considering one request for 50 articles_) Signed-off-by: Kevin Decherf <kevin@kdecherf.com> |
||
---|---|---|
.. | ||
Controller | ||
DependencyInjection | ||
Entity | ||
Form/Type | ||
Repository | ||
Resources/config | ||
WallabagApiBundle.php |