#define ZNC_PALAVER_VERSION "1.2.1"
#include <algorithm>
-#include <cmath>
#include <znc/Modules.h>
#include <znc/User.h>
}
unsigned int GetDelay(unsigned int uAttempts) {
- double minimumBackoff = 1;
- double maximumBackoff = 10;
- return std::max(std::min(pow((double)uAttempts, 2), maximumBackoff), minimumBackoff);
+ unsigned int minimumBackoff = 1;
+ unsigned int maximumBackoff = 10;
+ return std::max(std::min(uAttempts * 2, maximumBackoff), minimumBackoff);
}
};
line = await reader.readline()
assert line == b':*palaver!znc@znc.in PRIVMSG admin :Notification sent to 1 clients.\r\n'
- await asyncio.sleep(1.2)
+ await asyncio.sleep(2.2)
server.close()
await server.wait_closed()
line = await reader.readline()
assert line == b':*palaver!znc@znc.in PRIVMSG admin :Notification sent to 1 clients.\r\n'
- await asyncio.sleep(1.2)
+ await asyncio.sleep(2.2)
server.close()
await server.wait_closed()
line = await reader.readline()
assert line == b':*palaver!znc@znc.in PRIVMSG admin :Notification sent to 1 clients.\r\n'
- await asyncio.sleep(1.2)
+ await asyncio.sleep(2.2)
server.close()
await server.wait_closed()