Set `/api/v{version}/history` to default `entriesWithin=604800`
cohenaj194 opened this issue · comments
I noticed most of the 50X errors are currently coming from requests on specific items with many entries coming every few seconds:
http://universalis.app/api/history/Japan/29000?entries=4800
By default this searches all available history returning a very large amount of data. A simple method to reducing the 50X responses and ease the load on the system is to implement a default time range when none is specified so that every request will be for entriesWithin=604800
(i.e. one week) unless the user specifically sets entriesWithin
to a custom value. For example the following request would result in far less data and be easier on the system:
http://universalis.app/api/history/Japan/29000?entries=4800&entriesWithin=604800
I believe this might be a very simple fix changing entries from -1 (assuming that is the beginning of universalis history) to 7 days 604800L