Skip to content

Commit

Permalink
change BeforePersistObject to BeforeSaveObject
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev authored Oct 30, 2024
1 parent 948fcf0 commit 965c836
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/SIL.Harmony.Tests/PersistExtraDataTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public PersistExtraDataTests()
{
config.ObjectTypeListBuilder.DefaultAdapter().Add<ExtraDataModel>();
config.ChangeTypeListBuilder.Add<CreateExtraDataModelChange>();
config.BeforePersistObject = (obj, snapshot) =>
config.BeforeSaveObject = (obj, snapshot) =>
{
if (obj is ExtraDataModel extraDataModel)
{
Expand Down
2 changes: 1 addition & 1 deletion src/SIL.Harmony/CrdtConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class CrdtConfig
/// it does however increase database size as now objects are stored both in snapshots and in their projected tables
/// </summary>
public bool EnableProjectedTables { get; set; } = true;
public BeforeSaveObjectDelegate BeforePersistObject { get; set; } = (o, snapshot) => ValueTask.CompletedTask;
public BeforeSaveObjectDelegate BeforeSaveObject { get; set; } = (o, snapshot) => ValueTask.CompletedTask;
/// <summary>
/// after adding any commit validate the commit history, not great for performance but good for testing.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/SIL.Harmony/SnapshotWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private async ValueTask ApplyCommitChanges(IEnumerable<Commit> commits, bool upd
intermediateSnapshots[prevSnapshot.Entity.Id] = prevSnapshot;
}

await _crdtConfig.BeforePersistObject.Invoke(entity.DbObject, newSnapshot);
await _crdtConfig.BeforeSaveObject.Invoke(entity.DbObject, newSnapshot);

AddSnapshot(newSnapshot);
}
Expand Down

0 comments on commit 965c836

Please sign in to comment.