in ProcessManager/RequestReporter/CurrentProcessingUpsert.cs [85:113]
private static async Task<StatusCodeResult> RedisUpsert(ProcessingUpdate update, AppInsightsLogger appInsightsLogger, string redisOperation)
{
IDatabase db = null;
try
{
db = RedisConnection.GetDatabase();
}
catch (Exception ex)
{
appInsightsLogger.LogError(ex, update.ApiPath);
appInsightsLogger.LogRedisUpsert("Redis upsert failed.", redisOperation, DateTime.UtcNow.ToString(), update.ApiPath);
return new StatusCodeResult(500);
}
try
{
var keyname = APP_INSIGHTS_REQUESTS_KEY_NAME + "/" + update.ServiceCluster + update.ApiPath;
var newCount = await db.StringIncrementAsync(keyname, update.IncrementBy - update.DecrementBy);
appInsightsLogger.LogMetric(keyname, newCount, update.ApiPath);
return new StatusCodeResult(200);
}
catch (Exception ex)
{
appInsightsLogger.LogError(ex, update.ApiPath);
appInsightsLogger.LogRedisUpsert("Redis upsert failed.", redisOperation, DateTime.UtcNow.ToString(), update.ApiPath);
return new StatusCodeResult(500);
}
}