-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pr 824 integrate hydrating cache oracle chain #854
Pr 824 integrate hydrating cache oracle chain #854
Conversation
d55e462
to
bf3c8eb
Compare
024fd49
to
03d1749
Compare
I need to do a final refinement, like to remove unused mocks and I would like to add metrics also, if possible. |
24738bb
to
8d71327
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 suggestions for me:
folder
there is an "archethic_cache" folder at root, I would move the HydratingCache in here.
config
I think there are 2 configurations mixed in 1.
Here you have a UCOPrice config that contains both providers & cache configuration (refreshrate/ttl).
Then in the Supervisor, you transform this into {MFA}.
I suggest to have the {MFA} directly in a HydratingCache config (adding services should not require code changes in the cache).
uco_providers = [
Archethic.OracleChain.Services.UCOPrice.Providers.CoinX,
Archethic.OracleChain.Services.UCOPrice.Providers.CoinY,
Archethic.OracleChain.Services.UCOPrice.Providers.CoinZ
]
config :archethic, Archethic.OracleChain.Services.UCOPrice,
providers: uco_providers
config :archethic, Archethic.Utils.HydratingCache,
[<some_other_cache>] ++
Enum.map(uco_providers,&({&1, {&1, :fetch, [["eur", "usd"]]}, 60_000, :infinity}))
maybe we can create a behavior for cache. like @samuelmanzanera has done in Node KeyStore, shared secrets keystore for the |
I updated a few things as we discussed, I suggest to read commit by commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a slight comment about Archethic.OracleChain.ServiceCacheSupervisor
which I believe is not helpful, but no harm here.
Yes, the point is to enforce implementation to leverage hydrating cache for the fetching. |
The renewal of the hydrating message is done after the task is completed The timers are persisted in the state to have a better monitoring The tests are now using :erlang.trace to avoid undeterministic behaviors based on time.
9017cec
to
ef646d7
Compare
Description
This will address ticket #824 and
Fixes #824
Fixes #836
Type of change
There is still some refinement needed.
How Has This Been Tested?
Checklist: