Commit graph

26 commits

Author SHA1 Message Date
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
8f8865e4df Pass app_config to test() instead of single options 2020-09-05 00:59:51 +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
85c240b53d One debug message slipped away 2020-08-15 15:06:31 +01:00
5e7d0a33cc Add some debug printing 2020-08-15 14:58:20 +01:00
34040e5af1 Properly handle SIGINT to quit.
This puts ThreadPool::join() back to being private.
Eventia events now should inherit from Event, which will take
care of setting up the required callbacks so that events will
be notified about the main event loop stopping. Inheriting
from Event is currently not enforced.
2020-08-15 14:55:59 +01:00
4dd78099f1 Add TimerCreators 2020-08-12 01:04:28 +01:00
182e2148ac Reduce initial timer delays
This is test code anyways
2020-08-12 01:04:16 +01:00
cb500fd67c Add TimerCreators 2020-08-11 02:10:43 +01:00
3866462ff5 Add worker_threads setting 2020-08-11 01:33:11 +01:00
9bb2efb2ee Rename TimerGeneric to TimerOroApi
It's not *that* generic, it's really meant
to only work with oro::Api methods
2020-08-10 21:52:56 +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
c1e21bb8d6 Add TimerShops 2020-08-10 21:52:56 +01:00
2717817958 Attach GPL3+ licence 2020-08-10 11:22:25 +01:00
6b9502ea3e Store items and icons into the db 2020-08-10 02:34:09 +01:00
8fa434e76e Timer queries the remote api 2020-08-09 21:07:54 +01:00
c0461f6b09 More refactoring 2020-08-09 20:47:04 +01:00
034020e152 Remove thread pool selection code for now 2020-08-09 20:04:22 +01:00
9df60f074b Rename classes 2020-08-09 19:28:39 +01:00
7fb055cd40 Refactor event code.
This splits the thread pool code from the event code, and
class names are now wrong (I will update them in the next
commit). Also, this disregards the roar11 vs tf library
thing, taskflow was not working anyways and I will probably
remove all the conditional compilation stuff about it for
now.
2020-08-09 19:26:18 +01:00
9f0fed98e2 Get the concept working
A bit hackish because see ThreadPool.hpp.
Also code is dirty and it can't be stopped once running.
Building up from here.
2020-08-09 17:29:37 +01:00
fb69fd2289 Split html timed fetch into 2 classes
Signed-off-by: King_DuckZ <king_duckz@gmx.com>
2020-08-01 07:24:45 +02:00
d44529871c Add event loop with thread pool
I think it works

Signed-off-by: King_DuckZ <king_duckz@gmx.com>
2020-08-01 07:02:54 +02:00