summaryrefslogtreecommitdiffstats
path: root/config.py
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2024-10-05 19:48:25 +0200
committerGeorg Pfuetzenreuter2024-10-06 17:22:19 +0200
commit4d13d704dcd876bc6f4d182bdf3673fe1efd5a47 (patch)
treed7810df3cd9b46c2f82aefb3ca29d130510e731c /config.py
parent20797b44cd58e8a9eafac05d3534debfe938308f (diff)
downloadsnoparser-4d13d704dcd876bc6f4d182bdf3673fe1efd5a47.tar.gz
snoparser-4d13d704dcd876bc6f4d182bdf3673fe1efd5a47.tar.bz2
snoparser-4d13d704dcd876bc6f4d182bdf3673fe1efd5a47.zip
Clean up Redis logic
Simplify functions and move internal database interfaces into a more appropriate data structure. Configure all database numbers using a redis plugin group, instead of using a custom setting just for the whois database to make the setup more logical. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Diffstat (limited to 'config.py')
-rw-r--r--config.py39
1 files changed, 20 insertions, 19 deletions
diff --git a/config.py b/config.py
index 14654c5..f58e176 100644
--- a/config.py
+++ b/config.py
@@ -104,9 +104,21 @@ conf.registerGlobalValue(
# REDIS related settings below:
###
conf.registerGroup(SnoParser, "redis")
+conf.registerGroup(SnoParser.redis, "db")
conf.registerGlobalValue(
- SnoParser.redis,
- "db1",
+ SnoParser.redis.db,
+ "ips",
+ registry.Integer(
+ 2,
+ """
+ Redis: Database number for counting of IP ADDRESSES.
+ """,
+ private=True,
+ ),
+)
+conf.registerGlobalValue(
+ SnoParser.redis.db,
+ "nicks",
registry.Integer(
1,
"""
@@ -116,21 +128,21 @@ conf.registerGlobalValue(
),
)
conf.registerGlobalValue(
- SnoParser.redis,
- "db2",
+ SnoParser.redis.db,
+ "whois",
registry.Integer(
- 2,
+ 0,
"""
- Redis: Database number for counting of IP ADDRESSES.
+ Redis: Database number for WHOIS query caching.
""",
- private=True,
),
)
+
conf.registerGlobalValue(
SnoParser.redis,
"host",
registry.String(
- "127.0.0.1",
+ "localhost",
"""
Redis: IP address or hostname.
""",
@@ -218,16 +230,5 @@ conf.registerGlobalValue(
private=True,
),
)
-conf.registerGroup(SnoParser.whois, "redis")
-conf.registerGlobalValue(
- SnoParser.whois.redis,
- "db",
- registry.Integer(
- 0,
- """
- Redis: Database number for WHOIS query caching.
- """,
- ),
-)
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: