User control messages. (#56)

This commit is contained in:
Ravin Perera
2019-11-11 15:06:25 +05:30
committed by GitHub
parent 403f2e1b21
commit 39031c3157
10 changed files with 155 additions and 72 deletions

View File

@@ -7,10 +7,10 @@ namespace corebill
{
// How many violations can occur for a host before being escalated.
static const uint32_t VIOLATION_THRESHOLD = 10;
constexpr uint32_t VIOLATION_THRESHOLD = 10;
// Violation cooldown interval.
static const uint32_t VIOLATION_REFRESH_INTERVAL = 600 * 1000; // 10 minutes
constexpr uint32_t VIOLATION_REFRESH_INTERVAL = 600 * 1000; // 10 minutes
// Keeps track of violation count against offending hosts.
std::unordered_map<std::string, violation_stat> violation_counter;