Refactors the notification storage to support multiple stream IDs using a ConcurrentDictionary. This ensures that the bot can track and ignore duplicate notifications for multiple streams within a rolling 24-hour window, rather than only tracking the single most recent stream. - Updated ILastPostedStreamStore to include RemoveValuesOlderThan24Hours. - Switched LastPostedStreamStore to use ConcurrentDictionary with UTC timestamps. - Injected TimeProvider to enable deterministic testing of time-based expiration. - Added automatic cache pruning in NotificationHandler on every request. - Renamed Unit/LastPostedStreamStore.cs to Unit/LastPostedStreamStoreTests.cs and expanded test coverage.
8 lines
184 B
C#
8 lines
184 B
C#
namespace StevesBot.Webhook.YouTube;
|
|
|
|
internal interface ILastPostedStreamStore
|
|
{
|
|
void SetValue(string value);
|
|
bool HasValue(string value);
|
|
void RemoveValuesOlderThan24Hours();
|
|
} |