mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-19 10:01:24 +00:00
Added ThrottleAt config
This commit is contained in:
parent
8c36804950
commit
25061be0ea
2 changed files with 10 additions and 2 deletions
|
@ -346,6 +346,10 @@
|
||||||
* <desc>A boolean saying whether a clear alert should supersede the
|
* <desc>A boolean saying whether a clear alert should supersede the
|
||||||
* original message or simply act as a new version with the same
|
* original message or simply act as a new version with the same
|
||||||
* message identifier.</desc>
|
* message identifier.</desc>
|
||||||
|
* <term>ThrottleAt</term>
|
||||||
|
* <desc>An integer in the range 1 to 3600 saying how many alerts may
|
||||||
|
* be sent to an <em>Other</em> destination per hour. Any configuration
|
||||||
|
* outside this range results in the default of 12 being used.</desc>
|
||||||
* </deflist>
|
* </deflist>
|
||||||
*
|
*
|
||||||
* <p>When an EcAlerter instance is used by a Control server process,
|
* <p>When an EcAlerter instance is used by a Control server process,
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
#import "EcAlerter.h"
|
#import "EcAlerter.h"
|
||||||
#import "NSFileHandle+Printf.h"
|
#import "NSFileHandle+Printf.h"
|
||||||
|
|
||||||
|
static uint32_t throttleAt = 12;
|
||||||
|
|
||||||
@interface EcAlertRegex: NSObject
|
@interface EcAlertRegex: NSObject
|
||||||
{
|
{
|
||||||
NSRegularExpression *regex;
|
NSRegularExpression *regex;
|
||||||
|
@ -123,8 +125,6 @@
|
||||||
|
|
||||||
@implementation EcAlertThrottle
|
@implementation EcAlertThrottle
|
||||||
|
|
||||||
static uint32_t throttleAt = 12;
|
|
||||||
|
|
||||||
- (NSString*) description
|
- (NSString*) description
|
||||||
{
|
{
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
|
@ -395,6 +395,10 @@ replaceFields(NSDictionary *fields, NSString *template)
|
||||||
|
|
||||||
- (BOOL) configureWithDefaults: (NSDictionary*)c
|
- (BOOL) configureWithDefaults: (NSDictionary*)c
|
||||||
{
|
{
|
||||||
|
int i = [[c objectForKey: @"ThrottleAt"] intValue];
|
||||||
|
|
||||||
|
if (i <= 0 || i > 3600) i = 12;
|
||||||
|
throttleAt = i;
|
||||||
debug = [[c objectForKey: @"Debug"] boolValue];
|
debug = [[c objectForKey: @"Debug"] boolValue];
|
||||||
quiet = [[c objectForKey: @"Quiet"] boolValue];
|
quiet = [[c objectForKey: @"Quiet"] boolValue];
|
||||||
supersede = [[c objectForKey: @"Supersede"] boolValue];
|
supersede = [[c objectForKey: @"Supersede"] boolValue];
|
||||||
|
|
Loading…
Reference in a new issue