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 Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
@ -44,14 +45,28 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
{
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)
{
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)
@ -164,7 +179,14 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
[HubMethodName("read")]
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)

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

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

Loading…
Cancel
Save