Skip to content
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

refactor: code cleanup after rewards loop move #463

Merged
merged 3 commits into from
May 20, 2024
Merged

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented May 14, 2024

I am not entirely happy with the implementation details introduced in #462. In particular, I find the Obj reference/pointer-like structure too unusual/non-idiomatic in JavaScript.

I am proposing the following two changes:

refactor: allow submission of partial metrics

Keep track of the last rewards & job count inside the metrics component so that we don't have to maintain & share that state between "lib/rewards" and "lib/zinnia".

refactor: update contracts array in place

We used to perform in-place updates before #462, this commit is effectively brining that old design back.

Also, remove lib/obj.js as it's no longer needed.

Keep track of last rewards & job-count inside the metrics component,
so that we don't have to maintain & share that state between
"lib/rewards" and "lib/zinnia".

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Also remove `lib/obj.js` as it's no longer needed.

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bajtos bajtos requested a review from juliangruber May 14, 2024 15:10
Copy link
Member

@juliangruber juliangruber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great ideas!

lib/metrics.js Show resolved Hide resolved
lib/metrics.js Show resolved Hide resolved
@bajtos bajtos enabled auto-merge (squash) May 20, 2024 15:25
@bajtos bajtos merged commit 5719024 into main May 20, 2024
18 checks passed
@bajtos bajtos deleted the refactor-rewards-update branch May 20, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants