-
Notifications
You must be signed in to change notification settings - Fork 39
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
ObscuroScan: load eth price on init #1626
Conversation
WalkthroughThe changes primarily focus on modifying the polling interval for price updates in the frontend and adjusting the default server address in the backend. The polling interval is now set to 1 minute, improving readability and maintainability. The server address has been changed to "0.0.0.0:43910". Additionally, the polling process now starts with an immediate fetch callback execution. Changes
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (6)
- tools/obscuroscan_v2/backend/cmd/cli.go (1} hunks)
- tools/obscuroscan_v2/frontend/src/lib/config.dev.js (1} hunks)
- tools/obscuroscan_v2/frontend/src/lib/config.js (1} hunks)
- tools/obscuroscan_v2/frontend/src/lib/config.prod.js (1} hunks)
- tools/obscuroscan_v2/frontend/src/lib/poller.js (1} hunks)
- tools/obscuroscan_v2/frontend/src/stores/priceStore.js (2} hunks)
Files skipped from review due to trivial changes (4)
- tools/obscuroscan_v2/frontend/src/lib/config.dev.js
- tools/obscuroscan_v2/frontend/src/lib/config.js
- tools/obscuroscan_v2/frontend/src/lib/config.prod.js
- tools/obscuroscan_v2/frontend/src/lib/poller.js
Additional comments: 2
tools/obscuroscan_v2/backend/cmd/cli.go (1)
- 12-12: The server address port has been changed from 80 to 43910. Ensure that this port is open and properly configured in your network settings to avoid connection issues. Also, verify that all parts of the system that interact with this server are updated to use the new port.
tools/obscuroscan_v2/frontend/src/stores/priceStore.js (1)
- 12-12: The polling interval has been changed from
60*Config.pollingInterval
toConfig.pricePollingInterval
. Ensure that thepricePollingInterval
is defined and set correctly in theConfig
class. Also, verify that this change doesn't affect other parts of the code that might be using the oldpollingInterval
.
} catch (error) { | ||
console.error("Failed to fetch count:", error); | ||
} | ||
}, | ||
|
||
startPolling() { | ||
async startPolling() { |
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.
The startPolling
function has been made asynchronous, but there are no await
expressions inside it. If you plan to add asynchronous operations inside this function in the future, this change is fine. Otherwise, it's unnecessary to declare it as async
.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- tools/obscuroscan_v2/frontend/src/stores/priceStore.js (2} hunks)
Files skipped from review due to trivial changes (1)
- tools/obscuroscan_v2/frontend/src/stores/priceStore.js
@@ -9,7 +9,7 @@ export const usePriceStore = defineStore({ | |||
poller: new Poller(() => { | |||
const store = usePriceStore(); | |||
store.fetch(); | |||
}, 60*Config.pollingInterval) | |||
}, Config.pricePollingInterval) |
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 there a need to have the price updated at the second ? Also, I think it happened to me getting limit rated for polling too fast, might want to avoid the client limit rated for polling too fast too.
Why this change is needed
Currently it takes one minute before the eth price is requested so we see a loading circle. The other data also has a slight (1 second) delay before it loads because it waits for its polling interval.
What changes were made as part of this PR
Change the poller semantics to make the request immediately when started and then at the interval thereafter.
PR checks pre-merging
Please indicate below by ticking the checkbox that you have read and performed the required
PR checks