Skip to content

Use aioredis 2.0 for redis database - #1835

Merged
jacobtomlinson merged 1 commit into
opsdroid:masterfrom
MrNaif2018:fix/aioredis-2.0
Oct 5, 2021
Merged

jacobtomlinson merged 1 commit into
opsdroid:masterfrom
MrNaif2018:fix/aioredis-2.0

Conversation

@MrNaif2018

Copy link
Copy Markdown
Contributor

Description

This pull request makes use of aioredis 2.0 I decided to keep disconnect function even though it is not required anymore, see aioredis docs
I removed setting the parser as aioredis will fall back to pure-python implementation if hiredis is not installed.
Also creating the instance no longer connects, so to keep existing behaviour I added ping command

Fixes #1810

Also, I am glad to annually return to contribute to opsdroid this hacktoberfest! The best project, really 🎉

Status

READY

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

With sample skill skill.py

import random

from opsdroid.matchers import match_regex
from opsdroid.skill import Skill


class HelloSkill(Skill):
    @match_regex(r"hi|hello")
    async def hello(self, message):
        await message.respond("Hey")
        await self.opsdroid.memory.put(random.randint(1, 10), "test")

изображение
изображение

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@codecov

codecov Bot commented Sep 30, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #1835 (30a770c) into master (d8e985c) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1835   +/-   ##
=======================================
  Coverage   99.33%   99.33%           
=======================================
  Files          80       80           
  Lines        4834     4834           
=======================================
  Hits         4802     4802           
  Misses         32       32           
Impacted Files Coverage Δ
opsdroid/database/redis/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8e985c...30a770c. Read the comment docs.

@jacobtomlinson jacobtomlinson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome thanks so much!

@jacobtomlinson
jacobtomlinson merged commit 9c3a8ea into opsdroid:master Oct 5, 2021
@MrNaif2018
MrNaif2018 deleted the fix/aioredis-2.0 branch October 17, 2021 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade redis database backend to use aioredis v2

2 participants