Skip to content

Commit

Permalink
fix truncate long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
borgez committed May 29, 2024
1 parent 7b01c9f commit 2304ac4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/Marten/Internal/Sessions/DocumentSessionBase.SaveChanges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public async Task SaveChangesAsync(CancellationToken token = default)

throw;
}

_workTracker.Sort(Options);

if (Options.AutoCreateSchemaObjects != AutoCreate.None)
Expand Down Expand Up @@ -133,14 +134,11 @@ internal void ExecuteBatch(IUpdateBatch batch)
{
try
{
Options.ResiliencePipeline.Execute(
static (x, t) => x.Connection.ExecuteBatchPages(x.Pages, x.Exceptions), execution,
CancellationToken.None);
Options.ResiliencePipeline.Execute(static (x, t) => x.Connection.ExecuteBatchPages(x.Pages, x.Exceptions), execution, CancellationToken.None);
}
catch (Exception e)
{
pages.SelectMany(x => x.Operations).OfType<IExceptionTransform>()
.Concat(MartenExceptionTransformer.Transforms).TransformAndThrow(e);
pages.SelectMany(x => x.Operations).OfType<IExceptionTransform>().Concat(MartenExceptionTransformer.Transforms).TransformAndThrow(e);
}

if (execution.Exceptions.Count == 1)
Expand Down Expand Up @@ -198,15 +196,13 @@ internal async Task ExecuteBatchAsync(IUpdateBatch batch, CancellationToken toke
await executeBeforeCommitListeners(batch).ConfigureAwait(false);

await Options.ResiliencePipeline.ExecuteAsync(
static (e, t) => new ValueTask(e.Connection.ExecuteBatchPagesAsync(e.Pages, e.Exceptions, t)),
execution, token).ConfigureAwait(false);
static (e, t) => new ValueTask(e.Connection.ExecuteBatchPagesAsync(e.Pages, e.Exceptions, t)), execution, token).ConfigureAwait(false);

await executeAfterCommitListeners(batch).ConfigureAwait(false);
}
catch (Exception e)
{
pages.SelectMany(x => x.Operations).OfType<IExceptionTransform>()
.Concat(MartenExceptionTransformer.Transforms).TransformAndThrow(e);
pages.SelectMany(x => x.Operations).OfType<IExceptionTransform>().Concat(MartenExceptionTransformer.Transforms).TransformAndThrow(e);
}

if (execution.Exceptions.Count == 1)
Expand Down

0 comments on commit 2304ac4

Please sign in to comment.