-
Notifications
You must be signed in to change notification settings - Fork 3
Dev #75
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
base: stg
Are you sure you want to change the base?
Dev #75
Changes from all commits
911bf22
4af0597
bae2f51
877c41c
8131ca9
d42cd03
4b9e3fd
beea422
4d63f8a
b194ab1
3d681f1
23cc390
6d77bc7
16795ff
a00b29b
928b7e4
b945126
e40769b
cf02876
2607918
b59b6e8
f2b10f8
6265c85
0a3f046
8ba706c
32dd3a9
9010bc4
3027f84
20b933c
12e12cf
56d073d
fc2b427
21ff51e
025de27
4f2686c
bf38a1c
5d40dee
319b61a
f007876
b200545
418bfb6
ba596f8
00e96ce
7fccd3d
ecc41ba
795483c
0207e1c
4ee8460
ec72246
b2e85eb
ec92156
536a357
e9dc828
8b85e97
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ const pluginCreators = [ | |
| require('./plugins/proxy-router'), | ||
| require('./plugins/contracts'), | ||
| require('./plugins/devices'), | ||
| require('./plugins/validator-registry') | ||
| ] | ||
|
Comment on lines
14
to
18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error Handling IssueThere is no error handling for the scenario where a plugin might fail to load due to issues such as missing files or syntax errors. This can cause the application to crash. To improve the robustness of the application, consider wrapping the Suggested Change: const pluginCreators = [];
const pluginPaths = [
'./plugins/rates',
'./plugins/eth',
// other plugins
];
pluginPaths.forEach(path => {
try {
const plugin = require(path);
pluginCreators.push(plugin);
} catch (error) {
logger.error('Failed to load plugin:', path, error);
}
}); |
||
|
|
||
| function createCore() { | ||
|
|
||
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.
Performance and Memory Usage Issue
Loading all plugins at the start using
requirecan lead to high memory usage and potentially slow down the application startup, especially if some plugins are not immediately needed. Consider using a lazy loading technique, where plugins are only required when they are actually needed. This can be achieved by storing plugin identifiers or paths in the array and requiring them dynamically when initializing.Suggested Change: