From 5b38e2f294722b6fad9baf64436e0d3fe5620310 Mon Sep 17 00:00:00 2001 From: Ruben Bartelink Date: Thu, 18 Jan 2024 08:23:56 +0000 Subject: [PATCH] chore: LangVersion 8 (#442) --- Equinox.sln.DotSettings | 1 + global.json | 2 +- samples/Store/Domain.Tests/SavedForLaterTests.fs | 4 ++-- samples/Store/Domain/Cart.fs | 4 ++-- samples/Store/Domain/ContactPreferences.fs | 4 ++-- samples/Store/Domain/Favorites.fs | 8 ++++---- samples/Store/Domain/SavedForLater.fs | 4 ++-- samples/Store/Integration/TestOutput.fs | 2 +- samples/Tutorial/AsAt.fsx | 3 +-- samples/Tutorial/Cosmos.fsx | 3 +-- samples/Tutorial/Counter.fsx | 4 ++-- samples/Tutorial/Favorites.fsx | 2 +- samples/Tutorial/FulfilmentCenter.fsx | 14 ++++++-------- samples/Tutorial/Gapless.fs | 4 ++-- samples/Tutorial/Todo.fsx | 3 +-- src/Equinox.CosmosStore/CosmosStore.fs | 10 +++++----- src/Equinox.DynamoStore/DynamoStore.fs | 10 +++++----- src/Equinox.EventStore/EventStore.fs | 8 ++++---- .../Equinox.EventStoreDb.fsproj | 2 +- src/Equinox.EventStoreDb/EventStoreDb.fs | 2 +- src/Equinox.MessageDb/MessageDb.fs | 2 +- src/Equinox.MessageDb/MessageDbClient.fs | 2 +- src/Equinox.SqlStreamStore/SqlStreamStore.fs | 2 +- src/Equinox/Category.fs | 2 +- src/Equinox/Equinox.fsproj | 3 +-- .../DocumentStoreIntegration.fs | 2 +- tools/Equinox.Tools.TestHarness/Aggregate.fs | 6 +++--- 27 files changed, 54 insertions(+), 59 deletions(-) diff --git a/Equinox.sln.DotSettings b/Equinox.sln.DotSettings index 1c9d432ca..f1e93e4ee 100644 --- a/Equinox.sln.DotSettings +++ b/Equinox.sln.DotSettings @@ -16,6 +16,7 @@ True True True + True True True True diff --git a/global.json b/global.json index 0f050ba53..d07970ac2 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.300", + "version": "8.0.100", "rollForward": "latestMajor" } } diff --git a/samples/Store/Domain.Tests/SavedForLaterTests.fs b/samples/Store/Domain.Tests/SavedForLaterTests.fs index e5c5bd37b..85b4ecd55 100644 --- a/samples/Store/Domain.Tests/SavedForLaterTests.fs +++ b/samples/Store/Domain.Tests/SavedForLaterTests.fs @@ -84,10 +84,10 @@ let ``Event aggregation should carry set semantics`` (commands: Command list) = match event with | Events.Added appended -> state.UnionWith appended.skus | Events.Removed removed -> state.ExceptWith removed.skus - | Events.Merged merged -> state.UnionWith (merged.items |> Seq.map (fun s -> s.skuId)) + | Events.Merged merged -> state.UnionWith(merged.items |> Seq.map _.skuId) | Events.Compacted compacted -> state.Clear() - state.UnionWith (compacted.items |> Seq.map (fun s -> s.skuId)) + state.UnionWith(compacted.items |> Seq.map _.skuId) state let state',events = run commands diff --git a/samples/Store/Domain/Cart.fs b/samples/Store/Domain/Cart.fs index 8ca44adf5..c687c98cf 100644 --- a/samples/Store/Domain/Cart.fs +++ b/samples/Store/Domain/Cart.fs @@ -38,8 +38,8 @@ module Fold = module Snapshot = let generate (s: State) = - Events.Snapshotted <| - { items = [| for i in s.items -> { skuId = i.skuId; quantity = i.quantity; returnsWaived = i.returnsWaived } |] } + Events.Snapshotted + { items = [| for i in s.items -> { skuId = i.skuId; quantity = i.quantity; returnsWaived = i.returnsWaived } |] } let isOrigin = function Events.Snapshotted _ -> true | _ -> false let config = isOrigin, generate let hydrate (s: Events.Compaction.State): State = diff --git a/samples/Store/Domain/ContactPreferences.fs b/samples/Store/Domain/ContactPreferences.fs index cb40da307..db8c1343d 100644 --- a/samples/Store/Domain/ContactPreferences.fs +++ b/samples/Store/Domain/ContactPreferences.fs @@ -52,9 +52,9 @@ type Service internal (resolve: ClientId -> Equinox.Decider x.Version) + decider.QueryEx _.Version - member _.ReadStale(clientId) = + member _.ReadAnyCachedValue(clientId) = let decider = resolve clientId decider.Query(id, Equinox.LoadOption.AnyCachedValue) diff --git a/samples/Store/Domain/Favorites.fs b/samples/Store/Domain/Favorites.fs index 00a243dff..ea3399729 100644 --- a/samples/Store/Domain/Favorites.fs +++ b/samples/Store/Domain/Favorites.fs @@ -32,7 +32,7 @@ module Fold = type private InternalState(input: State) = let dict = System.Collections.Generic.Dictionary() - let favorite (e: Events.Favorited) = dict.[e.skuId] <- e + let favorite (e: Events.Favorited) = dict[e.skuId] <- e let favoriteAll (xs: Events.Favorited seq) = for x in xs do favorite x do favoriteAll input member _.ReplaceAllWith xs = dict.Clear(); favoriteAll xs @@ -53,7 +53,7 @@ let has skuId (state: Fold.State) = state |> Array.exists (fun x -> x.skuId = sk let decideFavorite date skuIds state = [| for skuId in Seq.distinct skuIds do - if state |> has skuId |> not then + if not (state |> has skuId) then Events.Favorited { date = date; skuId = skuId } |] let decideUnfavorite skuId state = [| @@ -76,10 +76,10 @@ type Service internal (resolve: ClientId -> Equinox.Decider = let decider = resolve clientId - decider.QueryEx(fun ctx -> ctx.Version, ctx.State) + decider.QueryEx(fun c -> c.Version, c.State) // NOTE not a real world example - used for an integration test; TODO get a better example where it's actually relevant - member _.UnfavoriteWithPostVersion(clientId, sku) = + member _.UnfavoriteWithPostVersion(clientId, sku): Async = let decider = resolve clientId decider.TransactEx((fun c -> decideUnfavorite sku c.State), render = _.Version) diff --git a/samples/Store/Domain/SavedForLater.fs b/samples/Store/Domain/SavedForLater.fs index ea2e3e90f..e2c46f2f5 100644 --- a/samples/Store/Domain/SavedForLater.fs +++ b/samples/Store/Domain/SavedForLater.fs @@ -127,8 +127,8 @@ type Service internal (resolve: ClientId -> Equinox.Decider bool) -> Async): Async = let decider = resolve clientId - decider.Transact(fun state-> async { - let contents = state |> Seq.map (fun i -> i.skuId) |> set + decider.Transact(fun state -> async { + let contents = state |> Seq.map _.skuId |> set let! skusToRemove = resolveSkus contents.Contains return (), decide maxSavedItems (Remove skusToRemove) state |> snd }) diff --git a/samples/Store/Integration/TestOutput.fs b/samples/Store/Integration/TestOutput.fs index d5064fa24..ea167c486 100644 --- a/samples/Store/Integration/TestOutput.fs +++ b/samples/Store/Integration/TestOutput.fs @@ -34,4 +34,4 @@ type TestOutput(testOutput: Xunit.Abstractions.ITestOutputHelper) = .WriteTo.Sink(testOutputAndTrace) .WriteTo.Seq("http://localhost:5341") |> fun c -> match sink with Some s -> c.WriteTo.Sink(s) | None -> c - |> fun c -> c.CreateLogger() + |> _.CreateLogger() diff --git a/samples/Tutorial/AsAt.fsx b/samples/Tutorial/AsAt.fsx index ad2f2872c..3c0173d1d 100644 --- a/samples/Tutorial/AsAt.fsx +++ b/samples/Tutorial/AsAt.fsx @@ -11,7 +11,7 @@ // - the same general point applies to over-using querying of streams for read purposes as we do here; // applying CQRS principles can often lead to a better model regardless of raw necessity -#if !LOCAL +#if LOCAL // Compile Tutorial.fsproj by either a) right-clicking or b) typing // dotnet build samples/Tutorial before attempting to send this to FSI with Alt-Enter #I "bin/Debug/net6.0/" @@ -19,7 +19,6 @@ #r "Serilog.dll" #r "Serilog.Sinks.Console.dll" #r "Serilog.Sinks.Seq.dll" -#r "Newtonsoft.Json.dll" #r "FSharp.UMX.dll" #r "FsCodec.dll" #r "Equinox.dll" diff --git a/samples/Tutorial/Cosmos.fsx b/samples/Tutorial/Cosmos.fsx index f42fe349d..fa6c7b803 100644 --- a/samples/Tutorial/Cosmos.fsx +++ b/samples/Tutorial/Cosmos.fsx @@ -1,4 +1,4 @@ -#if !LOCAL +#if LOCAL // Compile Tutorial.fsproj by either a) right-clicking or b) typing // dotnet build samples/Tutorial before attempting to send this to FSI with Alt-Enter #I "bin/Debug/net6.0/" @@ -6,7 +6,6 @@ #r "System.Runtime.Caching.dll" #r "Serilog.dll" #r "Serilog.Sinks.Console.dll" -#r "Newtonsoft.Json.dll" #r "TypeShape.dll" #r "Equinox.dll" #r "FSharp.UMX.dll" diff --git a/samples/Tutorial/Counter.fsx b/samples/Tutorial/Counter.fsx index a2775f4dc..0840ba56c 100644 --- a/samples/Tutorial/Counter.fsx +++ b/samples/Tutorial/Counter.fsx @@ -1,4 +1,4 @@ -#if !LOCAL +#if LOCAL // Compile Tutorial.fsproj before attempting to send this to FSI with Alt-Enter by either: // a) right-clicking or // b) typing dotnet build samples/Tutorial @@ -13,7 +13,7 @@ #r "FsCodec.Box.dll" #else #r "nuget:Equinox.MemoryStore, *-*" -#r "nuget:FsCodec.Box" +#r "nuget:FsCodec.Box, *-*" #r "nuget:Serilog.Sinks.Console" #endif diff --git a/samples/Tutorial/Favorites.fsx b/samples/Tutorial/Favorites.fsx index e72613ecb..43192c41b 100644 --- a/samples/Tutorial/Favorites.fsx +++ b/samples/Tutorial/Favorites.fsx @@ -1,4 +1,4 @@ -#if !LOCAL +#if LOCAL // Compile Tutorial.fsproj by either a) right-clicking or b) typing // dotnet build samples/Tutorial before attempting to send this to FSI with Alt-Enter #I "bin/Debug/net6.0/" diff --git a/samples/Tutorial/FulfilmentCenter.fsx b/samples/Tutorial/FulfilmentCenter.fsx index 6ec14f9ef..66735c3fa 100644 --- a/samples/Tutorial/FulfilmentCenter.fsx +++ b/samples/Tutorial/FulfilmentCenter.fsx @@ -1,10 +1,9 @@ -#if !LOCAL +#if LOCAL #I "bin/Debug/net6.0/" #r "System.Net.Http" #r "System.Runtime.Caching.dll" #r "Serilog.dll" #r "Serilog.Sinks.Console.dll" -#r "Newtonsoft.Json.dll" #r "Equinox.dll" #r "FSharp.UMX.dll" #r "FsCodec.dll" @@ -16,7 +15,6 @@ #else #r "nuget:Equinox.MemoryStore, *-*" #r "nuget:Equinox.CosmosStore, *-*" -#r "nuget:FsCodec.NewtonsoftJson, *-*" #r "nuget:FsCodec.SystemTextJson, *-*" #r "nuget:Serilog.Sinks.Console" #r "nuget:Serilog.Sinks.Seq" @@ -44,8 +42,8 @@ module Types = state : string zip : string isBusiness : bool option - isWeekendDeliveries : bool option - businessName : string option } + isWeekendDeliveries : bool option + businessName : string option } type Summary = { name : FcName option; address : Address option; contact : ContactInformation option; details : FcDetails option } module FulfilmentCenter = @@ -107,10 +105,10 @@ module FulfilmentCenter = member _.UpdateDetails(fc, value) = let decider = resolve fc decider.Transact(Decisions.updateDetails value) - member _.Read fc : Async = + member _.Read fc: Async = let decider = resolve fc decider.Query id - member _.QueryWithVersion(fc, render : Fold.State -> 'res) : Async = + member _.QueryWithVersion(fc, render: Fold.State -> 'res): Async = let decider = resolve fc decider.QueryEx(fun c -> c.Version, render c.State) @@ -184,4 +182,4 @@ module FulfilmentCenterSummary = decider.Transact(decideIngest version value) member _.TryRead id: Async = let decider = resolve id - decider.Query(Option.map (fun s -> s.state)) + decider.Query(Option.map _.state) diff --git a/samples/Tutorial/Gapless.fs b/samples/Tutorial/Gapless.fs index 9f03054b3..725e7ab37 100644 --- a/samples/Tutorial/Gapless.fs +++ b/samples/Tutorial/Gapless.fs @@ -46,10 +46,10 @@ module Fold = { reserved = state.reserved; confirmed = Set.empty; released = Set.empty; next = state.next } let fold (state: State) (xs: Events.Event[]): State = let s = State.toInternal state - let state' = (s, xs) ||> Array.fold (fun s -> s.Evolve) + let state' = (s, xs) ||> Array.fold _.Evolve state'.ToState() -let decideReserve count (state : Fold.State) : int64[] * Events.Event[] = +let decideReserve count (state : Fold.State): int64[] * Events.Event[] = failwith "TODO" let decideConfirm item (state : Fold.State) : Events.Event[] = diff --git a/samples/Tutorial/Todo.fsx b/samples/Tutorial/Todo.fsx index 0add45558..e96c5becc 100644 --- a/samples/Tutorial/Todo.fsx +++ b/samples/Tutorial/Todo.fsx @@ -1,11 +1,10 @@ -#if !LOCAL +#if LOCAL // Compile Tutorial.fsproj by either a) right-clicking or b) typing // dotnet build samples/Tutorial before attempting to send this to FSI with Alt-Enter #I "bin/Debug/net6.0/" #r "System.Runtime.Caching.dll" #r "Serilog.dll" #r "Serilog.Sinks.Console.dll" -#r "Newtonsoft.Json.dll" #r "TypeShape.dll" #r "Equinox.dll" #r "FSharp.UMX.dll" diff --git a/src/Equinox.CosmosStore/CosmosStore.fs b/src/Equinox.CosmosStore/CosmosStore.fs index 186502180..bde864a37 100644 --- a/src/Equinox.CosmosStore/CosmosStore.fs +++ b/src/Equinox.CosmosStore/CosmosStore.fs @@ -338,7 +338,7 @@ module Log = // Yes, there's a minor race here between the use of the values and the reset let duration = Stats.LogSink.Restart() if rows > 1 then logActivity "TOTAL" totalCount (totalRRu + totalWRu) totalMs - let measures: (string * (TimeSpan -> float)) list = [ "s", fun x -> x.TotalSeconds(*; "m", fun x -> x.TotalMinutes; "h", fun x -> x.TotalHours*) ] + let measures: (string * (TimeSpan -> float)) list = [ "s", _.TotalSeconds(*; "m", _.TotalMinutes; "h", _.TotalHours*) ] let logPeriodicRate name count rru wru = log.Information("{rru:n1}R/{wru:n1}W CU @ {count:n0} rp{unit}", rru, wru, count, name) for uom, f in measures do let d = f duration in if d <> 0. then logPeriodicRate uom (float totalCount/d |> int64) (totalRRu/d) (totalWRu/d) @@ -630,7 +630,7 @@ module internal Tip = | ReadResult.NotModified -> return Result.NotModified | ReadResult.NotFound -> return Result.NotFound | ReadResult.Found tip -> - let minIndex = maybePos |> Option.map (fun x -> x.index) + let minIndex = maybePos |> Option.map _.index return Result.Found (Position.fromEtagAndIndex (tip._etag, tip.n), tip.i, Enum.EventsAndUnfolds(tip, ?maxIndex = maxIndex, ?minIndex = minIndex) |> Array.ofSeq) } let tryFindOrigin (tryDecode: ITimelineEvent -> 'event voption, isOrigin: 'event -> bool) xs = let stack = ResizeArray() @@ -917,7 +917,7 @@ module Prune = container.GetItemQueryIterator<_>("SELECT c.id, c.i, c.n FROM c ORDER by c.i", requestOptions = qro) let mapPage i (t: StopwatchInterval) (page: FeedResponse) = let batches, rc, ms = Array.ofSeq page, page.RequestCharge, t.ElapsedMilliseconds - let next = Array.tryLast batches |> Option.map (fun x -> x.n) + let next = Array.tryLast batches |> Option.map _.n let reqMetric: Log.Measurement = { database = container.Database.Id; container = container.Id; stream = stream; interval = t; bytes = -1; count = batches.Length; ru = rc } let log = let evt = Log.Metric.PruneResponse reqMetric in log |> Log.prop "batchIndex" i |> Log.event evt log.Information("EqxCosmos {action:l} {batches} {ms:f1}ms n={next} {ru}RU", "PruneResponse", batches.Length, ms, Option.toNullable next, rc) @@ -928,7 +928,7 @@ module Prune = let handle (batches: BatchIndices[], rc) = task { let mutable delCharges, batchesDeleted, trimCharges, batchesTrimmed, eventsDeleted, eventsDeferred = 0., 0, 0., 0, 0, 0 let mutable lwm = None - for x in batches |> Seq.takeWhile (fun x -> isRelevant x || lwm = None) do + for x in batches |> Seq.takeWhile (fun x -> isRelevant x || Option.isNone lwm) do let batchSize = x.n - x.i |> int let eligibleEvents = max 0 (min batchSize (int (indexInclusive + 1L - x.i))) if isTip x then // Even if we remove the last event from the Tip, we need to retain a) unfolds b) position (n) @@ -1410,7 +1410,7 @@ type EventsContext return pos', data } let getRange direction startPos = - let startPos = startPos |> Option.map (fun x -> x.index) + let startPos = startPos |> Option.map _.index match direction with | Direction.Forward -> startPos, None | Direction.Backward -> None, startPos diff --git a/src/Equinox.DynamoStore/DynamoStore.fs b/src/Equinox.DynamoStore/DynamoStore.fs index e2f82d37c..ab0f65c56 100644 --- a/src/Equinox.DynamoStore/DynamoStore.fs +++ b/src/Equinox.DynamoStore/DynamoStore.fs @@ -160,7 +160,7 @@ module Batch = let (d, D), (m, M) = InternalBody.toStreamAndEncoding x.d, InternalBody.toStreamAndEncoding x.m { t = x.t; d = d; D = D; m = m; M = M; x = x.correlationId; y = x.causationId } let eventsToSchema (xs: Event[]): (*case*) string[] * EventSchema[] = - xs |> Array.map (fun x -> x.c), xs |> Array.map toEventSchema + xs |> Array.map _.c, xs |> Array.map toEventSchema let private toUnfoldSchema (x: Unfold): UnfoldSchema = let (d, D), (m, M) = InternalBody.toStreamAndEncoding x.d, InternalBody.toStreamAndEncoding x.m { i = x.i; t = x.t; c = x.c; d = d; D = D; m = m; M = M } @@ -366,7 +366,7 @@ module Log = rows <- rows + 1 | _ -> () if rows > 1 then logActivity "TOTAL" totalCount (totalRRu + totalWRu) totalMs - let measures: (string * (TimeSpan -> float)) list = [ "s", fun x -> x.TotalSeconds(*; "m", fun x -> x.TotalMinutes; "h", fun x -> x.TotalHours*) ] + let measures: (string * (TimeSpan -> float)) list = [ "s", _.TotalSeconds(*; "m", _.TotalMinutes; "h", _.TotalHours*) ] let logPeriodicRate name count rru wru = log.Information("{table} {rru:n1}R/{wru:n1}W CU @ {count:n0} rp{unit}", table, rru, wru, count, name) for uom, f in measures do let d = f res.Elapsed in if d <> 0. then logPeriodicRate uom (float totalCount/d |> int64) (totalRRu/d) (totalWRu/d) @@ -671,7 +671,7 @@ module internal Tip = | Res.NotModified -> return Res.NotModified | Res.NotFound -> return Res.NotFound | Res.Found tip -> - let minIndex = maybePos |> Option.map (fun x -> x.index) + let minIndex = maybePos |> Option.map _.index return Res.Found (Position.fromTip tip, Batch.baseIndex tip, tip |> enumEventsAndUnfolds (minIndex, maxIndex)) } module internal Query = @@ -921,7 +921,7 @@ module internal Prune = // need to sort by n to guarantee we don't ever leave an observable gap in the sequence let query ct = table.QueryIAndNOrderByNAscending(stream, maxItems, ct) let mapPage (i, t: StopwatchInterval, batches: BatchIndices[], rc) = - let next = Array.tryLast batches |> Option.map (fun x -> x.n) + let next = Array.tryLast batches |> Option.map _.n let reqMetric = Log.metric table.Name stream t -1 batches.Length rc let log = let evt = Log.Metric.PruneResponse reqMetric in log |> Log.prop "batchIndex" i |> Log.event evt log.Information("EqxDynamo {action:l} {batches} {ms:f1}ms n={next} {ru}RU", @@ -932,7 +932,7 @@ module internal Prune = let handle (batches: BatchIndices[], rc) = task { let mutable delCharges, batchesDeleted, trimCharges, batchesTrimmed, eventsDeleted, eventsDeferred = 0., 0, 0., 0, 0, 0 let mutable lwm = None - for x in batches |> Seq.takeWhile (fun x -> isRelevant x || lwm = None) do + for x in batches |> Seq.takeWhile (fun x -> isRelevant x || Option.isNone lwm) do let batchSize = x.n - x.index |> int let eligibleEvents = max 0 (min batchSize (int (indexInclusive + 1L - x.index))) if x.isTip then // Even if we remove the last event from the Tip, we need to retain a) unfolds b) position (n) diff --git a/src/Equinox.EventStore/EventStore.fs b/src/Equinox.EventStore/EventStore.fs index e0d3c2a89..21d43c829 100755 --- a/src/Equinox.EventStore/EventStore.fs +++ b/src/Equinox.EventStore/EventStore.fs @@ -121,7 +121,7 @@ module Log = // Yes, there's a minor race here between the use of the values and the reset let duration = Stats.LogSink.Restart() if rows > 1 then logActivity "TOTAL" totalCount totalMs - let measures: (string * (TimeSpan -> float)) list = [ "s", fun x -> x.TotalSeconds(*; "m", fun x -> x.TotalMinutes; "h", fun x -> x.TotalHours*) ] + let measures: (string * (TimeSpan -> float)) list = [ "s", _.TotalSeconds(*; "m", _.TotalMinutes; "h", _.TotalHours*) ] let logPeriodicRate name count = log.Information("rp{name} {count:n0}", name, count) for uom, f in measures do let d = f duration in if d <> 0. then logPeriodicRate uom (float totalCount/d |> int64) @@ -539,12 +539,12 @@ module private Discovery = let buildDns np (f: DnsClusterSettingsBuilder -> DnsClusterSettingsBuilder) = ClusterSettings.Create().DiscoverClusterViaDns().KeepDiscovering() |> fun s -> match np with NodePreference.Random -> s.PreferRandomNode() | NodePreference.PreferSlave -> s.PreferFollowerNode() | _ -> s - |> f |> fun s -> s.Build() + |> f |> _.Build() let buildSeeded np (f: GossipSeedClusterSettingsBuilder -> GossipSeedClusterSettingsBuilder) = ClusterSettings.Create().DiscoverClusterViaGossipSeeds().KeepDiscovering() |> fun s -> match np with NodePreference.Random -> s.PreferRandomNode() | NodePreference.PreferSlave -> s.PreferFollowerNode() | _ -> s - |> f |> fun s -> s.Build() + |> f |> _.Build() let configureDns clusterDns maybeManagerPort (x: DnsClusterSettingsBuilder) = x.SetClusterDns(clusterDns) @@ -599,7 +599,7 @@ type EventStoreConnector |> fun s -> match clientConnectionTimeout with Some v -> s.WithConnectionTimeoutOf v | None -> s // default: 1000 ms |> fun s -> match log with Some log -> log.Configure s | None -> s |> fun s -> match custom with Some c -> c s | None -> s - |> fun s -> s.Build() + |> _.Build() /// Yields an IEventStoreConnection configured and Connect()ed to a node (or the cluster) per the supplied `discovery` and `clusterNodePreference` preference member _.Connect diff --git a/src/Equinox.EventStoreDb/Equinox.EventStoreDb.fsproj b/src/Equinox.EventStoreDb/Equinox.EventStoreDb.fsproj index 7bd687c0e..d04bd2607 100644 --- a/src/Equinox.EventStoreDb/Equinox.EventStoreDb.fsproj +++ b/src/Equinox.EventStoreDb/Equinox.EventStoreDb.fsproj @@ -17,7 +17,7 @@ - contentfiles + diff --git a/src/Equinox.EventStoreDb/EventStoreDb.fs b/src/Equinox.EventStoreDb/EventStoreDb.fs index acfa04b66..e4220050d 100644 --- a/src/Equinox.EventStoreDb/EventStoreDb.fs +++ b/src/Equinox.EventStoreDb/EventStoreDb.fs @@ -117,7 +117,7 @@ module Log = // Yes, there's a minor race here between the use of the values and the reset let duration = Stats.LogSink.Restart() if rows > 1 then logActivity "TOTAL" totalCount totalMs - let measures: (string * (TimeSpan -> float)) list = [ "s", fun x -> x.TotalSeconds(*; "m", fun x -> x.TotalMinutes; "h", fun x -> x.TotalHours*) ] + let measures: (string * (TimeSpan -> float)) list = [ "s", _.TotalSeconds(*; "m", _.TotalMinutes; "h", _.TotalHours*) ] let logPeriodicRate name count = log.Information("rp{name} {count:n0}", name, count) for uom, f in measures do let d = f duration in if d <> 0. then logPeriodicRate uom (float totalCount/d |> int64) diff --git a/src/Equinox.MessageDb/MessageDb.fs b/src/Equinox.MessageDb/MessageDb.fs index f6b2d5f3b..8d376ad1c 100644 --- a/src/Equinox.MessageDb/MessageDb.fs +++ b/src/Equinox.MessageDb/MessageDb.fs @@ -119,7 +119,7 @@ module Log = // Yes, there's a minor race here between the use of the values and the reset let duration = Stats.LogSink.Restart() if rows > 1 then logActivity "TOTAL" totalCount totalMs - let measures: (string * (TimeSpan -> float)) list = [ "s", fun x -> x.TotalSeconds(*; "m", fun x -> x.TotalMinutes; "h", fun x -> x.TotalHours*) ] + let measures: (string * (TimeSpan -> float)) list = [ "s", _.TotalSeconds(*; "m", _.TotalMinutes; "h", _.TotalHours*) ] let logPeriodicRate name count = log.Information("rp{name} {count:n0}", name, count) for uom, f in measures do let d = f duration in if d <> 0. then logPeriodicRate uom (float totalCount/d |> int64) diff --git a/src/Equinox.MessageDb/MessageDbClient.fs b/src/Equinox.MessageDb/MessageDbClient.fs index aa4fcf73c..13a75c613 100644 --- a/src/Equinox.MessageDb/MessageDbClient.fs +++ b/src/Equinox.MessageDb/MessageDbClient.fs @@ -119,4 +119,4 @@ type internal MessageDbReader (connectionString: string, leaderConnectionString: use cmd = ReadStream.prepareCommand conn streamName fromPosition batchSize use! reader = cmd.ExecuteReaderAsync(ct) - return [| while reader.Read() do yield parseRow reader |] } + return [| while reader.Read() do parseRow reader |] } diff --git a/src/Equinox.SqlStreamStore/SqlStreamStore.fs b/src/Equinox.SqlStreamStore/SqlStreamStore.fs index f43ecc73e..1c49e7355 100644 --- a/src/Equinox.SqlStreamStore/SqlStreamStore.fs +++ b/src/Equinox.SqlStreamStore/SqlStreamStore.fs @@ -126,7 +126,7 @@ module Log = // Yes, there's a minor race here between the use of the values and the reset let duration = Stats.LogSink.Restart() if rows > 1 then logActivity "TOTAL" totalCount totalMs - let measures: (string * (TimeSpan -> float)) list = [ "s", fun x -> x.TotalSeconds(*; "m", fun x -> x.TotalMinutes; "h", fun x -> x.TotalHours*) ] + let measures: (string * (TimeSpan -> float)) list = [ "s", _.TotalSeconds(*; "m", _.TotalMinutes; "h", _.TotalHours*) ] let logPeriodicRate name count = log.Information("rp{name} {count:n0}", name, count) for uom, f in measures do let d = f duration in if d <> 0. then logPeriodicRate uom (float totalCount/d |> int64) diff --git a/src/Equinox/Category.fs b/src/Equinox/Category.fs index b6945f368..a2135cd3a 100755 --- a/src/Equinox/Category.fs +++ b/src/Equinox/Category.fs @@ -49,7 +49,7 @@ type Stream private () = System.Func<_, _>(fun sid -> cat.Stream(log, req, sid) |> DeciderCore<'event, 'state>) [] static member Resolve(cat: Category<'event, 'state, unit>, log): System.Func> = - Stream.Resolve(cat, log, ()) + cat.Resolve(log, ()) module Decider = let forRequest log (cat: Category<'event, 'state, 'req>) context streamId = diff --git a/src/Equinox/Equinox.fsproj b/src/Equinox/Equinox.fsproj index 04423f66f..76b699b1e 100644 --- a/src/Equinox/Equinox.fsproj +++ b/src/Equinox/Equinox.fsproj @@ -22,8 +22,7 @@ - contentfiles - + diff --git a/tests/Equinox.CosmosStore.Integration/DocumentStoreIntegration.fs b/tests/Equinox.CosmosStore.Integration/DocumentStoreIntegration.fs index ab40fdf80..f5eef48e2 100644 --- a/tests/Equinox.CosmosStore.Integration/DocumentStoreIntegration.fs +++ b/tests/Equinox.CosmosStore.Integration/DocumentStoreIntegration.fs @@ -337,7 +337,7 @@ type Tests(testOutputHelper) = let! result = service.Read id test <@ value = result @> - let! result = service.ReadStale id // should not trigger roundtrip + let! result = service.ReadAnyCachedValue id // should not trigger roundtrip test <@ value = result @> test <@ [EqxAct.TipNotModified; EqxAct.Append; EqxAct.TipNotModified] = capture.ExternalCalls @> } diff --git a/tools/Equinox.Tools.TestHarness/Aggregate.fs b/tools/Equinox.Tools.TestHarness/Aggregate.fs index f05ff65ad..d0f165b49 100644 --- a/tools/Equinox.Tools.TestHarness/Aggregate.fs +++ b/tools/Equinox.Tools.TestHarness/Aggregate.fs @@ -24,7 +24,7 @@ type TestResultAggregate with let testCountByOutcome = testResults - |> Seq.countBy (fun t -> t.OutcomeType) + |> Seq.countBy _.OutcomeType |> Seq.sortByDescending snd |> Seq.toArray @@ -90,8 +90,8 @@ module Observable = Observable.Buffer(source, bucketSize) |> Observable.filter (fun bucket -> bucket.Count > 0) |> Observable.map (fun bucket -> - let agg = bucket |> Seq.map (fun e -> e.payload) |> TestResultAggregate.FromEventBucket bucketSize - let e = bucket |> Seq.maxBy (fun e -> e.timestamp) + let agg = bucket |> Seq.map _.payload |> TestResultAggregate.FromEventBucket bucketSize + let e = bucket |> Seq.maxBy _.timestamp { payload = agg ; timestamp = e.timestamp ; hostname = e.hostname }) |> Observable.filter (fun agg -> agg.payload.count > 0 || agg.payload.sessionErrors.Length > 0)