Closed detouched closed 6 years ago
The build is failing due to some openssl pre-configuration failure, not sure how to fix that but I guess it's unrelated to the proposed change.
@detouched Hello!
Thanks for taking your time of doing this!.
The build is failing because the test that executes the Git checkout via SSH can't be decrypted with the pull requests that aren't coming from me. This is something I really need to check. But it is totally unrelated, it is due on how travis-ci works with encrypted files.
I'm leaving some comments before pulling it in but I like the shape of it.
Thanks for the quick reply :)
Sorry again that I wasn't looking at the up-to-date source code while making the change, my bad. I'll drop the try-catch and the corresponding test, as well as the unused variable and update this PR.
Current
TimedReloadStrategy
has two flaws:Timer
terminates if any reload attempt fails with an exception. This makes this reload strategy suck when dealing with I/O, for instance, reloading from a remote URL.register(ConfigProvider)
is called multiple times, only the lastConfigProvider
can effectively callderegister()
, while all previously registered timers will be lost. This makes the reload strategy not reusable, while its API suggests that it might be reused.This change makes
TimedReloadStrategy
use a scheduled executor service with error-pronereload()
call to prevent subsequent reload attempts from auto-cancelling, and use a map ofConfigProvider
s to register and unregister them properly.