Commit graph

12 commits

Author SHA1 Message Date
a32044a4b5 Add optional lzma support for stored json responses
When enabled entries in the DB are stored as base64
encoded xz data. To uncompress save to a file
my_json.base64 and run:

cat my_json.base64 | base64 --decode | unxz --decompress - > my_json.txt
2020-09-05 14:00:22 +01:00
baf0256f84 Store next access time in the db when server returns 429 2020-09-05 02:14:42 +01:00
e24ebcf8e8 Add timeout options to config file
This allows users to specify the minimum wait for each
request. The (currently wrong) estimate of
retry_after / rate_limit is calculated, and the max
between that and the setting in the config file is
used.
2020-09-05 01:36:26 +01:00
9d4d52bed0 Add store_raw_json option to config 2020-09-05 00:41:01 +01:00
2d62b44ebc Group parameters in a TimerSettings struct 2020-08-16 13:41:32 +01:00
a3153bcc66 Move TimerBase's g_extra_wait out to the settings file 2020-08-16 13:31:08 +01:00
b06456e4b0 Restore timeouts from previous run
This is quite a big update, the new feature is that when the
program starts it loads the next update time from the db if
present. If so it resumes the timers from there. Maximum wait
time is currently capped at 24h.

TimerOroApi is not templated on methods anymore, rather on
the new DBOperation enum. This is so that it has that enum
value to pass it to other functions. This could've been a
separate commit, but wth...

Magic enum allows me to iterate over an enum's values at
build time, it's useful for building the query in OriginsDB
for the SELECT in the access table
(see make_select_last_access_str()).
2020-08-16 06:28:58 +01:00
cb500fd67c Add TimerCreators 2020-08-11 02:10:43 +01:00
5bf036f056 Replace timers with a templated one
They all do the same thing, the only difference
is the method they call on oro::Api, so
template on that
2020-08-10 21:52:56 +01:00
4b3d88b2f0 Move more crap to the base class 2020-08-10 21:52:56 +01:00
2717817958 Attach GPL3+ licence 2020-08-10 11:22:25 +01:00
5bc151a3ec Refactor timer code
No need to copy-paste that much stuff, especially since
there are going to be more timer types in the future.
2020-08-10 03:01:54 +01:00