Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
919838e
feat: update cachemanage and cachereposiotry implementations to async.
Jun 27, 2025
0cd7449
[CodeFactor] Apply fixes to commit 919838e
code-factor Jun 27, 2025
dcd584f
Merge branch 'main' into feature/cacheasync
HarryKambo Jun 27, 2025
60f982f
Feat: updated test cases and fixed minor changes.
Jun 30, 2025
8aeb939
Merge branch 'feature/cacheasync' of https://github.com/HarryKambo/Cr…
Jun 30, 2025
8394e7c
[CodeFactor] Apply fixes
code-factor Jun 30, 2025
ba637b8
Merge branch 'main' into feature/cacheasync
guibranco Jul 13, 2025
82cfc19
Merge branch 'main' into feature/cacheasync
guibranco Jul 15, 2025
3af3711
Merge branch 'main' into feature/cacheasync
guibranco Jul 29, 2025
42f526d
Merge branch 'main' into feature/cacheasync
guibranco Aug 8, 2025
c88c0d6
Merge branch 'main' into feature/cacheasync
guibranco Dec 4, 2025
225923e
Merge branch 'main' into feature/cacheasync
guibranco Apr 21, 2026
e91f3cb
Merge branch 'main' into feature/cacheasync
guibranco May 19, 2026
6f5e4e1
Merge branch 'main' into feature/cacheasync
guibranco May 19, 2026
79374c7
Merge branch 'main' into feature/cacheasync
guibranco May 19, 2026
2480e5f
Merge branch 'main' into feature/cacheasync
guibranco May 23, 2026
82b2f44
Merge branch 'main' into feature/cacheasync
guibranco May 23, 2026
49a037a
Merge branch 'main' into feature/cacheasync
guibranco Jul 2, 2026
7036712
Merge branch 'main' into feature/cacheasync
guibranco Jul 4, 2026
e5d61cc
refactor: switch to TryGetAsync for cache retrieval
guibranco Jul 4, 2026
2fe1340
Format files
guibranco Jul 4, 2026
69f06e9
refactor: implement SafeWriteLine to handle test output safely
guibranco Jul 4, 2026
2ebad8a
fix: restrict actions to main repo for external PRs
guibranco Jul 4, 2026
62f1260
refactor: replace async delay with thread sleep in tests
guibranco Jul 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
371 changes: 279 additions & 92 deletions Src/CrispyWaffle.CouchDB/Cache/CouchDBCacheRepository.cs

Large diffs are not rendered by default.

420 changes: 362 additions & 58 deletions Src/CrispyWaffle.Redis/Cache/RedisCacheRepository.cs

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions Src/CrispyWaffle.Utils/Communications/SmtpMailer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
Expand All @@ -8,6 +8,7 @@
using System.Net.Mime;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using CrispyWaffle.Cache;
using CrispyWaffle.Configuration;
Expand Down Expand Up @@ -329,7 +330,8 @@ public async Task SendAsync()
}
catch (Exception e)
{
if (!HandleExtension(e, cacheKey))
var result = await HandleExtension(e, cacheKey);
if (!result)
{
throw;
}
Expand All @@ -343,7 +345,10 @@ public async Task SendAsync()
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
private async Task SendInternalAsync(string cacheKey)
{
if (CacheManager.TryGet(cacheKey, out bool exists) && exists)
(bool exists, _) = await CacheManager.TryGetAsync<object>(cacheKey, CancellationToken.None);


if (exists)
Comment thread
guibranco marked this conversation as resolved.
{
LogConsumer.Trace("E-mail sending disabled due {0}", "network error");
return;
Expand All @@ -366,8 +371,8 @@ private async Task SendInternalAsync(string cacheKey)
/// </summary>
/// <param name="e">The exception that occurred.</param>
/// <param name="cacheKey">The cache key to prevent repeated failures.</param>
/// <returns><see langword="true"/> if the exception was handled; otherwise, <see langword="false"/>.</returns>
private static bool HandleExtension(Exception e, string cacheKey)
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
private static async Task<bool> HandleExtension(Exception e, string cacheKey)
{
TelemetryAnalytics.TrackMetric("SMTPError", e.Message);
if (
Expand All @@ -376,7 +381,7 @@ private static bool HandleExtension(Exception e, string cacheKey)
|| e.Message.IndexOf(@"5.0.3", StringComparison.InvariantCultureIgnoreCase) != -1
)
{
CacheManager.Set(true, cacheKey, new TimeSpan(0, 15, 0));
await CacheManager.SetAsync(true, cacheKey, new TimeSpan(0, 15, 0));
return true;
}

Expand Down
Loading
Loading