move classes around, name caches more consistently, add more caches
This commit is contained in:
parent
e86b37ce2a
commit
e17dcf90a1
30 changed files with 443 additions and 51 deletions
|
|
@ -1,15 +0,0 @@
|
|||
using Catalogger.Backend.Database.Redis;
|
||||
using Humanizer;
|
||||
|
||||
namespace Catalogger.Backend.Services;
|
||||
|
||||
public class RedisWebhookCache(RedisService redisService) : IWebhookCache
|
||||
{
|
||||
public async Task<Webhook?> GetWebhookAsync(ulong channelId) =>
|
||||
await redisService.GetAsync<Webhook?>(WebhookKey(channelId));
|
||||
|
||||
public async Task SetWebhookAsync(ulong channelId, Webhook webhook) =>
|
||||
await redisService.SetAsync(WebhookKey(channelId), webhook, 24.Hours());
|
||||
|
||||
private static string WebhookKey(ulong channelId) => $"webhook:{channelId}";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue