diff options
| author | Georg Pfuetzenreuter | 2024-10-05 19:48:25 +0200 |
|---|---|---|
| committer | Georg Pfuetzenreuter | 2024-10-06 17:22:19 +0200 |
| commit | 4d13d704dcd876bc6f4d182bdf3673fe1efd5a47 (patch) | |
| tree | d7810df3cd9b46c2f82aefb3ca29d130510e731c /config.py | |
| parent | 20797b44cd58e8a9eafac05d3534debfe938308f (diff) | |
| download | snoparser-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.py | 39 |
1 files changed, 20 insertions, 19 deletions
@@ -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: |
