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

Incorrect max capacity update in SiteStatsDaoRedis._update_basic() #71

Open
TomerGodinger opened this issue Feb 2, 2022 · 0 comments · May be fixed by #78
Open

Incorrect max capacity update in SiteStatsDaoRedis._update_basic() #71

TomerGodinger opened this issue Feb 2, 2022 · 0 comments · May be fixed by #78

Comments

@TomerGodinger
Copy link

The current code (lines 52-54) sets the new maximum capacity to reading.wh_generated:

max_capacity = self.redis.hget(key, SiteStats.MAX_CAPACITY)
if not max_capacity or reading.current_capacity > float(max_capacity):
    self.redis.hset(key, SiteStats.MAX_CAPACITY, reading.wh_generated)

Instead, line 54 should set it to reading.current_capacity:

    self.redis.hset(key, SiteStats.MAX_CAPACITY, reading.current_capacity)
@siddydutta siddydutta linked a pull request May 30, 2022 that will close this issue
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 a pull request may close this issue.

1 participant