Tweak the whowas config defaults

- Decrease the default number of nick groups.
- Increase the days to keep records for.
- Enable update on nick change by default.
- Remove the upper bounds on the fields.
This commit is contained in:
Sadie Powell 2024-08-28 14:16:48 +01:00
parent a84010cd64
commit c0a68cea9c
2 changed files with 13 additions and 12 deletions

View File

@ -940,24 +940,25 @@
# # # #
<whowas <whowas
# groupsize: Maximum entries per nick shown when performing # groupsize: Maximum entries per nick shown when performing
# a /WHOWAS <nick>. # a /WHOWAS <nick>. Defaults to 10.
groupsize="10" groupsize="10"
# maxgroups: Maximum number of nickgroups that can be added to # maxgroups: Maximum number of nickgroups that can be added to
# the list so that /WHOWAS does not use a lot of resources on # the list so that /WHOWAS does not use a lot of resources on
# large networks. # large networks. Defaults to 10000.
maxgroups="100000" maxgroups="10000"
# maxkeep: Maximum time a nick is kept in the whowas list # maxkeep: Maximum time a nick is kept in the whowas list
# before being pruned. Time may be specified in seconds, # before being pruned. Time may be specified in seconds,
# or in the following format: 1y2w3d4h5m6s. Minimum is # or in the following format: 1y2w3d4h5m6s. Minimum is
# 1 hour. # 1 hour. Defaults to 7 days.
maxkeep="3d" maxkeep="7d"
# nickupdate: Whether to update the WHOWAS database on nick # nickupdate: Whether to update the WHOWAS database on nick
# change as well as quit. This can significantly increase the # change as well as quit. This can significantly increase the
# memory usage of your IRC server. # memory usage of your IRC server so it is not recommended
nickupdate="no"> # for large networks. Defaults to yes.
nickupdate="yes">
#-#-#-#-#-#-#-#-#-#-#-#-#-#- BAN OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-#-# #-#-#-#-#-#-#-#-#-#-#-#-#-#- BAN OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-#-#
# # # #

View File

@ -470,12 +470,12 @@ public:
void ReadConfig(ConfigStatus& status) override void ReadConfig(ConfigStatus& status) override
{ {
const auto& tag = ServerInstance->Config->ConfValue("whowas"); const auto& tag = ServerInstance->Config->ConfValue("whowas");
unsigned int NewGroupSize = tag->getNum<unsigned int>("groupsize", 10, 0, 10000); const auto groupsize = tag->getNum<unsigned int>("groupsize", 10);
unsigned int NewMaxGroups = tag->getNum<unsigned int>("maxgroups", 10240, 0, 1000000); const auto maxgroups = tag->getNum<unsigned int>("maxgroups", 10000);
unsigned int NewMaxKeep = static_cast<unsigned int>(tag->getDuration("maxkeep", 3600, 3600)); const auto maxkeep = static_cast<unsigned int>(tag->getDuration("maxkeep", 7*24*60*60, 60*60));
nickupdate = tag->getBool("nickupdate"); nickupdate = tag->getBool("nickupdate", true);
cmd.manager.UpdateConfig(NewGroupSize, NewMaxGroups, NewMaxKeep); cmd.manager.UpdateConfig(groupsize, maxgroups, maxkeep);
} }
}; };