-
Notifications
You must be signed in to change notification settings - Fork 21
[Config] Remove dependency to API in non-API code #231
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
[Config] Remove dependency to API in non-API code #231
Conversation
|
Depends on #229. |
hoh
left a comment
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.
Great fix.
A few comments I'd like to discuss.
| } | ||
|
|
||
|
|
||
| app_config = Config(schema=get_defaults()) |
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.
I see multiple uses of aleph.config.app_config. Why not using aleph.config.get_config() everywhere and marking this variable as private with a _ prefix ?
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.
Is this variable useful versus using @lru_cache on def get_config() ?
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.
It conveys the intent better IMO. Using LRU cache when there's only one return value seems a bit counterintuitive.
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.
What about the first comment ?
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.
I think the usage in job_utils.py is legit as we need to initialize the global variable. The other one in get_ipfs_api looks like an oversight from my part.
39b60fc to
6a9fe97
Compare
6a9fe97 to
70b4bd2
Compare
Removed all dependencies to the aiohttp app object in non-API code. This object was used all over the place to retrieve the config object. Instead, we now use a global variable to store the config object itself.
70b4bd2 to
8209122
Compare
Removed all dependencies to the aiohttp app object in non-API code. This object was used all over the place to retrieve the config object. Instead, we now use a global variable to store the config object itself.
Removed all dependencies to the aiohttp app object in non-API code.
This object was used all over the place to retrieve the config
object. Instead, we now use a global variable to store the config
object itself.