def _update_page_views(pipeline: redis.client.Pipeline, date: str, expire: int) -> None: key: str = f"stats:views:{date}" pipeline.incr(key) pipeline.expire(key, expire)
def _update_visitor_count(pipeline: redis.client.Pipeline, date: str, expire: int) -> None: key: str = f"stats:visitors:{date}" pipeline.pfadd(key, flask.g.session.id_) pipeline.expire(key, expire)