Browse Source

Merge pull request #674 from colinin/upt-5.3.4

adjusting dependency order
pull/712/head
yx lin 3 years ago
committed by GitHub
parent
commit
ecea63acbb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 28
      aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs
  2. 2
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs

28
aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs

@ -6,6 +6,7 @@ using LINGYUN.Abp.IM.Messages;
using LINGYUN.Abp.RealTime.Localization; using LINGYUN.Abp.RealTime.Localization;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -44,14 +45,28 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
{ {
await base.OnConnectedAsync(); await base.OnConnectedAsync();
await SendUserOnlineStateAsync(); try
{
await SendUserOnlineStateAsync();
}
catch(Exception ex)
{
Logger.LogWarning("An error occurred in the OnConnected method:{message}", ex.Message);
}
} }
public override async Task OnDisconnectedAsync(Exception exception) public override async Task OnDisconnectedAsync(Exception exception)
{ {
await base.OnDisconnectedAsync(exception); await base.OnDisconnectedAsync(exception);
await SendUserOnlineStateAsync(false); try
{
await SendUserOnlineStateAsync(false);
}
catch (Exception ex)
{
Logger.LogWarning("An error occurred in the OnDisconnected method:{message}", ex.Message);
}
} }
protected virtual async Task SendUserOnlineStateAsync(bool isOnlined = true) protected virtual async Task SendUserOnlineStateAsync(bool isOnlined = true)
@ -164,7 +179,14 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
[HubMethodName("read")] [HubMethodName("read")]
public virtual async Task ReadAsync(ChatMessage chatMessage) public virtual async Task ReadAsync(ChatMessage chatMessage)
{ {
await Processor?.ReadAsync(chatMessage); try
{
await Processor?.ReadAsync(chatMessage);
}
catch (Exception ex)
{
Logger.LogWarning("An error occurred in the Read method:{message}", ex.Message);
}
} }
protected virtual async Task<string> SendMessageAsync(string methodName, ChatMessage chatMessage, bool callbackException = false) protected virtual async Task<string> SendMessageAsync(string methodName, ChatMessage chatMessage, bool callbackException = false)

2
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs

@ -62,12 +62,12 @@ namespace LY.MicroService.RealtimeMessage;
typeof(AbpBackgroundTasksExceptionHandlingModule), typeof(AbpBackgroundTasksExceptionHandlingModule),
typeof(TaskManagementEntityFrameworkCoreModule), typeof(TaskManagementEntityFrameworkCoreModule),
typeof(AbpMessageServiceEntityFrameworkCoreModule), typeof(AbpMessageServiceEntityFrameworkCoreModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpSaasEntityFrameworkCoreModule), typeof(AbpSaasEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule), typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpTextTemplatingEntityFrameworkCoreModule), typeof(AbpTextTemplatingEntityFrameworkCoreModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule), typeof(AbpDataDbMigratorModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule), typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpAuthorizationOrganizationUnitsModule), typeof(AbpAuthorizationOrganizationUnitsModule),

Loading…
Cancel
Save