Exemple #1
0
        public async Task AddAsync(HttpRequestRecord entry)
        {
            await Task.WhenAll(
                _redis.ListLeftPushAsync(GetRedisKey($"Records"), entry.Id),
                _redis.StringSetAsync(GetRedisKey($"RecordEntry?{entry.Id}"), Serialize(entry)),
                _redis.StringSetAsync(GetRedisKey($"RecordEntryInfo?{entry.Id}"), Serialize(HttpRequestRecordInfo.CreateFromRecord(entry)))
                );

            await Task.WhenAll(
                _redis.ListTrimAsync(GetRedisKey($"Records"), 0, _options.RetentionMaxRequests),
                _redis.KeyExpireAsync(GetRedisKey($"Records"), _options.Expiry),
                _redis.KeyExpireAsync(GetRedisKey($"RecordEntry?{entry.Id}"), _options.Expiry),
                _redis.KeyExpireAsync(GetRedisKey($"RecordEntryInfo?{entry.Id}"), _options.Expiry)
                );
        }
Exemple #2
0
 public async Task UpdateAsync(HttpRequestRecord entry)
 {
     await Task.WhenAll(
         _redis.StringSetAsync(GetRedisKey($"RecordEntry?{entry.Id}"), Serialize(entry)),
         _redis.StringSetAsync(GetRedisKey($"RecordEntryInfo?{entry.Id}"), Serialize(HttpRequestRecordInfo.CreateFromRecord(entry)))
         );
 }