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

Need to expire values for metrics cache #19

Open
frennkie opened this issue Aug 6, 2020 · 2 comments
Open

Need to expire values for metrics cache #19

frennkie opened this issue Aug 6, 2020 · 2 comments
Assignees

Comments

@frennkie
Copy link
Owner

frennkie commented Aug 6, 2020

con.hmset(f'{key}.{item}', ret_dict[item])

@frennkie frennkie self-assigned this Aug 6, 2020
@frennkie
Copy link
Owner Author

frennkie commented Aug 6, 2020

Might be better to avoid get_redis_connection and hmset.

@frennkie
Copy link
Owner Author

frennkie commented Aug 6, 2020

shop/models.py update_metrics()

        from django.core.cache import cache
        for item in ret_dict:
            print({f'{key}2.{item}.{x}': ret_dict[item][x] for x in ret_dict[item]})
            cache.set_many({f'{key}2.{item}.{x}': ret_dict[item][x] for x in ret_dict[item]}, timeout=120)

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

No branches or pull requests

1 participant