Sfoglia il codice sorgente

修复消息队列更新数据错误

qinchaoyue 2 mesi fa
parent
commit
a5d52df256
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8 1
      src/Hotline.Repository.SqlSugar/BaseRepository.cs

+ 8 - 1
src/Hotline.Repository.SqlSugar/BaseRepository.cs

@@ -368,7 +368,14 @@ namespace Hotline.Repository.SqlSugar
 
         public async Task UpdateAsync(TEntity entity, bool ignoreNullColumns = true, CancellationToken cancellationToken = default)
         {
-            _serviceProvider.GetService<DatabaseEventDispatcher>()?.Dispatch(entity, DataFilterType.UpdateByObject, true);
+            try
+            {
+                _serviceProvider.GetService<DatabaseEventDispatcher>()?.Dispatch(entity, DataFilterType.UpdateByObject, true);
+            }
+            catch (Exception e)
+            {
+                var msg = e.Message;
+            }
             await Db.Updateable(entity)
                 .IgnoreColumns(ignoreAllNullColumns: ignoreNullColumns)
                 .IgnoreColumns(d => d.CreationTime)