Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
OwainWilliams authored Feb 8, 2024
2 parents af61748 + 9844481 commit 55346dd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions Core/Services/IMastodonService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ public interface IMastodonService
Task<List<MastodonStatus>> GetStatuses(int limit);

Task<List<MastodonCustomEmoji>> GetCustomEmojis();

}
}
13 changes: 12 additions & 1 deletion Core/Services/MastodonService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class MastodonService : IMastodonService
private const int FeedCacheMinutes = 15;
private const string EmojiCacheKey = "mastodonemojis";



public MastodonService(ILogger<MastodonService> logger, AppCaches appCaches)
{
_logger = logger;
Expand All @@ -33,6 +35,16 @@ public async Task<List<MastodonStatus>> GetStatuses(int limit)
TimeSpan.FromMinutes(FeedCacheMinutes));

return await posts!;

if (posts != null)
{
return await posts;
}
else
{
return await Task.FromResult(new List<MastodonStatus>());
}

}


Expand Down Expand Up @@ -61,7 +73,6 @@ private async Task<List<MastodonStatus>> LoadStatuses(int limit)
return response.Body.ToList();



}
catch (Exception ex)
{
Expand Down

0 comments on commit 55346dd

Please sign in to comment.