Skip to content

Commit

Permalink
Reverted #133 (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
masesdevelopers authored Oct 22, 2023
1 parent 0da2759 commit a1fb8af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/net/KEFCore/Storage/EntityTypeChanged.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public enum ChangeKindType
/// The <see cref="Key"/> was removed
/// </summary>
Removed = 4,
/// <summary>
/// The <see cref="Key"/> was added or updated
/// </summary>
Upserted = Added | Updated,
}

internal EntityTypeChanged(IEntityType entityType, ChangeKindType changeKind, object key)
Expand Down Expand Up @@ -74,4 +78,8 @@ internal EntityTypeChanged(IEntityType entityType, ChangeKindType changeKind, ob
/// Helper to understand if the <see cref="Key"/> was removed
/// </summary>
public bool KeyRemoved => ChangeKind.HasFlag(ChangeKindType.Removed);
/// <summary>
/// Helper to understand if the <see cref="Key"/> was added or updated
/// </summary>
public bool KeyUpserted => ChangeKind.HasFlag(ChangeKindType.Added) | ChangeKind.HasFlag(ChangeKindType.Updated);
}
2 changes: 1 addition & 1 deletion src/net/KEFCore/Storage/Internal/EntityTypeProducer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private void KafkaCompactedReplicator_OnRemoteUpdate(IKNetCompactedReplicator<TK
{
Task.Factory.StartNew(() =>
{
_onChangeEvent?.Invoke(new EntityTypeChanged(_entityType, arg1.ContainsKey(arg2.Key) ? EntityTypeChanged.ChangeKindType.Updated : EntityTypeChanged.ChangeKindType.Added, arg2.Key));
_onChangeEvent?.Invoke(new EntityTypeChanged(_entityType, EntityTypeChanged.ChangeKindType.Upserted, arg2.Key));
});
}

Expand Down

0 comments on commit a1fb8af

Please sign in to comment.