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

[stayrtr] add hash check on slurm data #115

Merged
merged 1 commit into from
Feb 29, 2024
Merged

Conversation

netixx
Copy link
Contributor

@netixx netixx commented Feb 28, 2024

Hash was already performed on cache/vrp data
this performs it for slurm as well,
preventing uneeded refreshes when neither
file have changed.

Partial fix for #114.

Copy link
Contributor

@cjeker cjeker left a comment

Choose a reason for hiding this comment

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

Diff looks reasonable apart from the obvious copy-paste error.

@@ -533,12 +533,21 @@ func (s *state) updateSlurm(file string) (bool, error) {
RefreshStatusCode.WithLabelValues(file, fmt.Sprintf("%d", code)).Inc()
}

hsum := newSHA256(data)
if s.lasthashCache != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the wrong hash you check here. Should be lasthashSlurm.
Also in the bytes.Compare() below.

Hash was already performed on cache/vrp data
this performs it for slurm as well,
preventing uneeded refreshes when neither
file have changed.

Partial fix for bgp#114.
@ties ties merged commit c3652d3 into bgp:master Feb 29, 2024
3 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
Development

Successfully merging this pull request may close these issues.

3 participants