服务频繁500故障修复

main
陈伟 3 weeks ago
parent 1ece182c51
commit f5bd2dbe3d

@ -1599,9 +1599,10 @@ namespace OpenAuth.App.ServiceApp
.AsQueryable()
.Where(r => r.Topic == topic)
.Where(r => r.CreateTime > time)
.Where(r => SqlFunc.JsonLike(r.Data, "wind_speed"))
.Where(r => SqlFunc.JsonContainsFieldName(r.Data, "wind_speed"))
.OrderByDescending(r => r.CreateTime)
.FirstAsync();
//SqlFunc.JsonContainsFieldName(log.Data, "wind_speed")
x.Stop();
Console.WriteLine("耗时:" + x.ElapsedMilliseconds / 1000);
//不太可能为空

@ -1,17 +1,11 @@
using DocumentFormat.OpenXml.Math;
using System.Text;
using Infrastructure;
using Infrastructure.Helpers;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.CodeAnalysis.Text;
using Newtonsoft.Json;
using OpenAuth.App.ServiceApp.Request;
using OpenAuth.Repository.Domain;
using OpenAuth.WebApi.Model.RabbitMQService;
using RabbitMQ.Client;
using System.Globalization;
using System.Security.Cryptography;
using System.Text;
namespace OpenAuth.WebApi.Controllers.ServiceControllers
{
@ -101,7 +95,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
"sdhc"
}
};
var jsonBody = Newtonsoft.Json.JsonConvert.SerializeObject(data);
var jsonBody = JsonConvert.SerializeObject(data);
using var httpClient = new HttpClient(handler);
// 添加请求头
// 只把非 Content-Type 的头加到 request

@ -1,7 +1,6 @@
using Microsoft.AspNetCore.Connections;
using RabbitMQ.Client.Events;
using System.Text;
using RabbitMQ.Client;
using System.Text;
using RabbitMQ.Client.Events;
namespace OpenAuth.WebApi.Model.RabbitMQService
{

@ -60,6 +60,9 @@
<Reference Include="Autofac.Extensions.DependencyInjection">
<HintPath>..\..\..\Users\Administrator\.nuget\packages\autofac.extensions.dependencyinjection\4.0.0\lib\netstandard1.1\Autofac.Extensions.DependencyInjection.dll</HintPath>
</Reference>
<Reference Include="RabbitMQ.Client">
<HintPath>bin\Debug\net6.0\RabbitMQ.Client.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

Loading…
Cancel
Save