feat(youtube): multiple stream notifications
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.
This commit is contained in:
@@ -4,4 +4,5 @@ internal interface ILastPostedStreamStore
|
||||
{
|
||||
void SetValue(string value);
|
||||
bool HasValue(string value);
|
||||
void RemoveValuesOlderThan24Hours();
|
||||
}
|
||||
Reference in New Issue
Block a user