aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRahiel Kasim <rahiel@protonmail.ch>2016-01-05 22:15:11 +0100
committerRahiel Kasim <rahiel@protonmail.ch>2016-01-05 22:15:11 +0100
commitd0ae1c51f6d6048d1291baf6d0fe22da5ab4010c (patch)
treec803e2128c93a51837c0d220387b51b0b5bd1bf2
parent286b01ef0112ee5b8c41fad66ebd8e15002c3429 (diff)
communicate with Redis over a Unix socket
-rw-r--r--README.md8
-rw-r--r--bismillah.py2
2 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md
index aea5fa3..69976cb 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,14 @@ TOKEN = "<your-token-here>"
Disable group chats for the bot by sending the BotFather the `/setjoingroups`
command and customize the bot further.
+The bot uses a Unix socket to communicate with Redis. Put the following in your
+`redis.conf`:
+
+```
+unixsocket /tmp/redis.sock
+unixsocketperm 766
+```
+
## Data files
The bot serves Quranic data collected from several projects. These are necessary
diff --git a/bismillah.py b/bismillah.py
index 5dc10a6..5da1828 100644
--- a/bismillah.py
+++ b/bismillah.py
@@ -32,7 +32,7 @@ from secret import TOKEN
english = Quran("translation")
tafsir = Quran("tafsir")
-r = StrictRedis()
+r = StrictRedis(unix_socket_path="/tmp/redis.sock")
redis_namespace = ""