From 005dc19eff16bd38d40d36823be455cf99357ef8 Mon Sep 17 00:00:00 2001 From: nless Date: Thu, 27 Jan 2022 14:32:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B8=85=E9=99=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerRunner.cs | 2 +- src/Vertex.Abstractions/Snapshot/SnapshotMeta.cs | 2 ++ src/Vertex.Runtime/Actor/FlowActor.cs | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerRunner.cs b/src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerRunner.cs index 6191afd..dbba75b 100644 --- a/src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerRunner.cs +++ b/src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerRunner.cs @@ -98,7 +98,7 @@ public Task Run() $"An error occurred in {this.Queue}"); foreach (var item in list.Where(o => !o.Success)) { - this.Model.Model.BasicReject(((BasicGetResult) item.Origin).DeliveryTag, true); + this.Model.Model.BasicReject(((BasicGetResult)item.Origin).DeliveryTag, true); } } finally diff --git a/src/Vertex.Abstractions/Snapshot/SnapshotMeta.cs b/src/Vertex.Abstractions/Snapshot/SnapshotMeta.cs index 0a29950..05671fb 100644 --- a/src/Vertex.Abstractions/Snapshot/SnapshotMeta.cs +++ b/src/Vertex.Abstractions/Snapshot/SnapshotMeta.cs @@ -7,7 +7,9 @@ public record SnapshotMeta public long DoingVersion { get; set; } public long Version { get; set; } + public long MinEventTimestamp { get; set; } + public long MinEventVersion { get; set; } public bool IsLatest { get; set; } diff --git a/src/Vertex.Runtime/Actor/FlowActor.cs b/src/Vertex.Runtime/Actor/FlowActor.cs index 5aaeb44..beca611 100644 --- a/src/Vertex.Runtime/Actor/FlowActor.cs +++ b/src/Vertex.Runtime/Actor/FlowActor.cs @@ -25,7 +25,6 @@ using Vertex.Runtime.Exceptions; using Vertex.Runtime.Options; using Vertex.Utils.Emit; -using Vertex.Abstractions.Event; namespace Vertex.Runtime.Actor { From 6f7718090e65494289d6b77d53905ebe06a6de36 Mon Sep 17 00:00:00 2001 From: nless Date: Tue, 19 Jul 2022 10:12:34 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=8C=85=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Packages.props | 36 +++++++++---------- examples/Packages.props | 9 +++-- .../Transfer.Server/Transfer.Server.csproj | 2 +- .../Consumer/ConsumerRunner.cs | 2 +- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/Packages.props b/Packages.props index 3d4aa1e..765acc2 100644 --- a/Packages.props +++ b/Packages.props @@ -7,37 +7,37 @@ - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + + + - - + + - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -52,13 +52,13 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/examples/Packages.props b/examples/Packages.props index 79e718f..a63e0dd 100644 --- a/examples/Packages.props +++ b/examples/Packages.props @@ -2,11 +2,10 @@ - + - - - - + + + \ No newline at end of file diff --git a/examples/Transfer.Server/Transfer.Server.csproj b/examples/Transfer.Server/Transfer.Server.csproj index 63af07d..4fa3f71 100644 --- a/examples/Transfer.Server/Transfer.Server.csproj +++ b/examples/Transfer.Server/Transfer.Server.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerRunner.cs b/src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerRunner.cs index dbba75b..cfebc0a 100644 --- a/src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerRunner.cs +++ b/src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerRunner.cs @@ -72,7 +72,7 @@ public Task Run() } else { - list.Add(new BytesBox(whileResult.Body, whileResult)); + list.Add(new BytesBox(whileResult.Body.ToArray(), whileResult)); } if ((DateTimeOffset.UtcNow - batchStartTime).TotalMilliseconds > From c39418df7a48d45ba70fd783a7946feb8aee0a90 Mon Sep 17 00:00:00 2001 From: nless Date: Tue, 19 Jul 2022 11:22:37 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8DMySQL=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=BC=82=E5=B8=B8=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Storage/Vertex.Storage.Linq2db/Entities/EventEntity.cs | 7 +++---- .../Vertex.Storage.Linq2db/Entities/SnapshotEntity.cs | 3 +-- .../Vertex.Storage.Linq2db/Entities/SubSnapshotEntity.cs | 6 ++---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Storage/Vertex.Storage.Linq2db/Entities/EventEntity.cs b/src/Storage/Vertex.Storage.Linq2db/Entities/EventEntity.cs index da2eaf9..4f88bfc 100644 --- a/src/Storage/Vertex.Storage.Linq2db/Entities/EventEntity.cs +++ b/src/Storage/Vertex.Storage.Linq2db/Entities/EventEntity.cs @@ -6,17 +6,16 @@ namespace Vertex.Storage.Linq2db.Entities [Table] public class EventEntity { - [Column] - [Column(DataType = DataType.VarChar, Length = 200)] + [Column(Length = 200, CanBeNull = false)] public TPrimaryKey ActorId { get; set; } - [Column(DataType = DataType.VarChar, Length = 200)] + [Column(DataType = DataType.VarChar, CanBeNull = false, Length = 200)] public string Name { get; set; } [Column(DataType = DataType.Text)] public string Data { get; set; } - [Column(DataType = DataType.VarChar, Length = 200)] + [Column(DataType = DataType.VarChar, CanBeNull = false, Length = 200)] public string FlowId { get; set; } [Column] diff --git a/src/Storage/Vertex.Storage.Linq2db/Entities/SnapshotEntity.cs b/src/Storage/Vertex.Storage.Linq2db/Entities/SnapshotEntity.cs index 752906d..67b9867 100644 --- a/src/Storage/Vertex.Storage.Linq2db/Entities/SnapshotEntity.cs +++ b/src/Storage/Vertex.Storage.Linq2db/Entities/SnapshotEntity.cs @@ -7,8 +7,7 @@ namespace Vertex.Storage.Linq2db.Entities public class SnapshotEntity { [PrimaryKey] - [Column] - [Column(DataType = DataType.VarChar, Length = 200)] + [Column(Length = 200, CanBeNull = false)] public TPrimaryKey Id { get; set; } [Column(DataType = DataType.Text)] diff --git a/src/Storage/Vertex.Storage.Linq2db/Entities/SubSnapshotEntity.cs b/src/Storage/Vertex.Storage.Linq2db/Entities/SubSnapshotEntity.cs index f7c1a96..3262d28 100644 --- a/src/Storage/Vertex.Storage.Linq2db/Entities/SubSnapshotEntity.cs +++ b/src/Storage/Vertex.Storage.Linq2db/Entities/SubSnapshotEntity.cs @@ -1,5 +1,4 @@ -using LinqToDB; -using LinqToDB.Mapping; +using LinqToDB.Mapping; namespace Vertex.Storage.Linq2db.Entities { @@ -7,8 +6,7 @@ namespace Vertex.Storage.Linq2db.Entities public class SubSnapshotEntity { [PrimaryKey] - [Column] - [Column(DataType = DataType.VarChar, Length = 200)] + [Column(Length = 200, CanBeNull = false)] public TPrimaryKey Id { get; set; } [Column]