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

Use ssl for sentinel #48

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions falkordb/falkordb.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
protocol=protocol)

if Is_Sentinel(conn):
self.sentinel, self.service_name = Sentinel_Conn(conn)
conn = self.sentinel.master_for(self.service_name)
self.sentinel, self.service_name = Sentinel_Conn(conn, ssl)
conn = self.sentinel.master_for(self.service_name, ssl=ssl)

Check warning on line 102 in falkordb/falkordb.py

View check run for this annotation

Codecov / codecov/patch

falkordb/falkordb.py#L101-L102

Added lines #L101 - L102 were not covered by tests

self.connection = conn
self.flushdb = conn.flushdb
Expand Down
4 changes: 3 additions & 1 deletion falkordb/sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
return "redis_mode" in info and info["redis_mode"] == "sentinel"

# create a sentinel connection from a Redis connection
def Sentinel_Conn(conn):
def Sentinel_Conn(conn, ssl):
# collect masters
masters = conn.sentinel_masters()

Expand Down Expand Up @@ -41,6 +41,8 @@
sentinel_kwargs['username'] = connection_kwargs['username']
if 'password' in connection_kwargs:
sentinel_kwargs['password'] = connection_kwargs['password']
if ssl:
sentinel_kwargs['ssl'] = True

Check warning on line 45 in falkordb/sentinel.py

View check run for this annotation

Codecov / codecov/patch

falkordb/sentinel.py#L44-L45

Added lines #L44 - L45 were not covered by tests

return (Sentinel(sentinels_conns, sentinel_kwargs=sentinel_kwargs, **connection_kwargs), service_name)

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "FalkorDB"
version = "1.0.5"
version = "1.0.6"
description = "Python client for interacting with FalkorDB database"
authors = ["FalkorDB inc <info@falkordb.com>"]

Expand Down