Commit 82bc68c
Fix support for Redis Unix-Domainsocket-connections (#5214)
### Motivation
I usually use Redis with UnixDomainsocket-connections, using
connection-URLs beginning with `unix://`. When trying to use this for
persistence in NiceGUI I discovered, that this throws the error 'Could
not load data from Redis with key ...'. The reason is, that the option
`socket_keepalive` is not present when `redis.from_url()` leads to the
use of Redis' class `UnixDomainSocketConnection`.
### Implementation
The fix builds a connection-parameter-dict in the class
`RedisPersistentDict` and adds the option 'socket_keepalive' ony when
the URL is not beginning with `unix://`. Furthermore it reuses this dict
for the Redis-connection in the same Class on `initialize_sync()`.
### Progress
- [x] I chose a meaningful title that completes the sentence: "If
applied, this PR will..."
- [x] The implementation is complete.
- [x] Pytests are are not necessary.
- [x] Documentation is not necessary.
---------
Co-authored-by: Rodja Trappe <rodja@zauberzeug.com>
Co-authored-by: Falko Schindler <falko@zauberzeug.com>1 parent 6d5b751 commit 82bc68c
1 file changed
+8
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 43 | + | |
50 | 44 | | |
51 | 45 | | |
52 | 46 | | |
| |||
0 commit comments