Skip to content

zadd memory leak #2

@Notanotherdotcom

Description

@Notanotherdotcom

In case anyone checks this - this line seems to to grow unchecked over time as it doesn't seem to prune ever:

$this->redis->zAdd('ts', $time, $key);

It's also not prefixed so multiple pw sites would be better having this:

$this->redis->zAdd("{$this->prefix}:ts", $time, $key);

Current solution is this:

$tsKey = $this->prefix . ':ts';
$sessionLifetime = isset($this->config->sessionExpireSeconds) ? (int)$this->config->sessionExpireSeconds : 3600;

	$this->redis->zAdd($tsKey, $time, $key);
	$this->redis->zRemRangeByScore($tsKey, 0, $time - $sessionLifetime);

I may fork this module to work on it further as I know it's old, but putting the notes here as an issue report for now for others to see

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions