CmdCustom: Increase probability of displaying upgrade message

We have received reports from people that have upgraded, but seemingly
have not seen release notes in the `task news` command. One of the
causes here could be the fact that the probability of displaying the
footnote about running `task news` is `1/10`.

Increase the probability to 1/4.
This commit is contained in:
Tomas Babej 2021-10-18 21:32:41 -04:00
parent dc81bf5fb5
commit 072b38d326
No known key found for this signature in database
GPG key ID: B0747C6578F7D2F5

View file

@ -254,7 +254,7 @@ int CmdCustom::execute (std::string& output)
{
std::random_device device;
std::mt19937 random_generator(device());
std::uniform_int_distribution<std::mt19937::result_type> ten_percent(1, 10);
std::uniform_int_distribution<std::mt19937::result_type> twentyfive_percent(1, 4);
std::string NEWS_NOTICE = (
"Recently upgraded to 2.6.0. "
@ -262,7 +262,7 @@ int CmdCustom::execute (std::string& output)
);
// 1 in 10 chance to display the message.
if (ten_percent(random_generator) == 10)
if (twentyfive_percent(random_generator) == 4)
{
if (Context::getContext ().verbose ("footnote"))
Context::getContext ().footnote (NEWS_NOTICE);