Skip to content

Commit

Permalink
Smaller memory footprint for processed items (#106)
Browse files Browse the repository at this point in the history
* Smaller memory footprint for processed items

* Add config option whether to check for duplicates

* oops

* Create HttpServerConfig class

* Remove unused global http config variable
  • Loading branch information
versx authored Dec 16, 2020
1 parent bb5fbc4 commit ed801bb
Show file tree
Hide file tree
Showing 6 changed files with 374 additions and 129 deletions.
1 change: 1 addition & 0 deletions config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
"despawnTimeMinimumMinutes": 5,
"reloadSubscriptionChangesMinutes": 1,
"maxNotificationsPerMinute": 10,
"checkForDuplicates": true,
"debug": false,
"logLevel": "Trace"
}
7 changes: 7 additions & 0 deletions src/Configuration/WhConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ public class WhConfig
[JsonProperty("maxNotificationsPerMinute")]
public ushort MaxNotificationsPerMinute { get; set; }

/// <summary>
/// Gets or sets a value determining whether to check for duplicate webhook messages or not
/// </summary>
[JsonProperty("checkForDuplicates")]
public bool CheckForDuplicates { get; set; }

/// <summary>
/// Gets or sets whether to log incoming webhook data to a file
/// </summary>
Expand Down Expand Up @@ -161,6 +167,7 @@ public WhConfig()
DespawnTimeMinimumMinutes = 5;
ReloadSubscriptionChangesMinutes = 1;
MaxNotificationsPerMinute = 10;
CheckForDuplicates = true;
}

/// <summary>
Expand Down
21 changes: 21 additions & 0 deletions src/Net/Configuration/HttpServerConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace WhMgr.Net.Configuration
{
public class HttpServerConfig
{
public string Host { get; set; }

public ushort Port { get; set; }

public int DespawnTimerMinimum { get; set; }

public bool CheckForDuplicates { get; set; }

public HttpServerConfig()
{
Host = "*";
Port = 8008;
DespawnTimerMinimum = 5;
CheckForDuplicates = true;
}
}
}
Loading

0 comments on commit ed801bb

Please sign in to comment.