in src/cartservice/src/cartstore/ValkeyCartStore.cs [151:168]
public async Task EmptyCartAsync(string userId)
{
_logger.LogInformation("EmptyCartAsync called with userId={userId}", userId);
try
{
EnsureRedisConnected();
var db = _redis.GetDatabase();
// Update the cache with empty cart for given user
await db.HashSetAsync(userId, new[] { new HashEntry(CartFieldName, _emptyCartBytes) });
await db.KeyExpireAsync(userId, TimeSpan.FromMinutes(60));
}
catch (Exception ex)
{
throw new RpcException(new Status(StatusCode.FailedPrecondition, $"Can't access cart storage. {ex}"));
}
}