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

Fixes #24178: Initialize score on webapp start up #5388

Conversation

VinceMacBuche
Copy link
Member

@VinceMacBuche VinceMacBuche commented Feb 9, 2024

https://issues.rudder.io/issues/24178

Adds an init sequence for score. especially for system update score. I don't think we need it for compliance since it will initialise very fast for each node (at first agent run/ or even compliance fetch)

@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the enh_24178/initialize_score_on_webapp_start_up branch from 76d96a6 to bc91cdf Compare February 9, 2024 09:40
@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the enh_24178/initialize_score_on_webapp_start_up branch from bc91cdf to 4071007 Compare February 9, 2024 10:28
ZIO.ifZIO(readScore.getAll().map(_.exists(g => handler.initForScore(g._2))))(
handler.initEvents.flatMap(ZIO.foreach(_)(handleEvent(_))).unit,
().succeed
)
Copy link
Member

Choose a reason for hiding this comment

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

I think handle event needs to be an `UIO[Unit]. Not catching an error in it leads to unroverable errors and a non working rudder - for ex, when the init event has a problem, it rudder starts but in a bad state .

@fanf fanf force-pushed the enh_24178/initialize_score_on_webapp_start_up branch from 4071007 to ef67ddf Compare February 10, 2024 20:23
Copy link
Member

@fanf fanf left a comment

Choose a reason for hiding this comment

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

Changed the init method to be always succeding so that an error during init does not break Rudder but is correctly logged.

@fanf
Copy link
Member

fanf commented Feb 10, 2024

OK, merging this PR

@fanf fanf merged commit ef67ddf into Normation:branches/rudder/8.1 Feb 10, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants