Reset page after crawling.

This commit is contained in:
Haiping Chen 2024-08-26 15:19:00 -05:00
parent 7527f783d8
commit 8bbe78e7f5
2 changed files with 6 additions and 10 deletions

View file

@ -1,6 +1,8 @@
using BotSharp.Abstraction.Infrastructures;
namespace BotSharp.Abstraction.Browsing.Models;
public class MessageInfo
public class MessageInfo : ICacheKey
{
public string AgentId { get; set; } = null!;
public string UserId { get; set; } = null!;
@ -8,4 +10,7 @@ public class MessageInfo
public string? MessageId { get; set; }
public string? TaskId { get; set; }
public string StepId { get; set; } = Guid.NewGuid().ToString();
public string GetCacheKey()
=> $"{nameof(MessageInfo)}-{AgentId}-{UserId}-{ContextId}-{MessageId}-{TaskId}-{StepId}";
}

View file

@ -16,9 +16,6 @@ public class CacheService : ICacheService
public async Task<T?> GetAsync<T>(string key)
{
#if DEBUG
return default;
#endif
if (string.IsNullOrEmpty(_settings.Redis))
{
return default;
@ -42,9 +39,6 @@ public class CacheService : ICacheService
public async Task<object> GetAsync(string key, Type type)
{
#if DEBUG
return default;
#endif
if (string.IsNullOrEmpty(_settings.Redis))
{
return default;
@ -69,9 +63,6 @@ public class CacheService : ICacheService
public async Task SetAsync<T>(string key, T value, TimeSpan? expiry)
{
#if DEBUG
return;
#endif
if (string.IsNullOrEmpty(_settings.Redis))
{
return;