Skip to content

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

@TomerGodinger

Description

@TomerGodinger

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions