diff --git a/src/Propulsion/StreamFilter.fs b/src/Propulsion/StreamFilter.fs index a466433f..b07bdafc 100644 --- a/src/Propulsion/StreamFilter.fs +++ b/src/Propulsion/StreamFilter.fs @@ -7,7 +7,7 @@ type StreamFilter([] allowCats, [] denyCats, [] al [] allowEts, [] denyEts, [] ?incIndexes, [] ?log) = - let log = defaultArg log Serilog.Log.Logger + let log = lazy defaultArg log Serilog.Log.Logger let defA x = match x with null -> Array.empty | xs -> Seq.toArray xs let allowCats, denyCats, incIndexes = defA allowCats, defA denyCats, defaultArg incIndexes false @@ -35,8 +35,8 @@ type StreamFilter([] allowCats, [] denyCats, [] al let denyCats = if incIndexes then denyCats else Array.append denyCats [| "^\$" |] let allowSns, denySns = match allowSns, denySns with [||], [||] -> [|".*"|], [||] | x -> x let allowEts, denyEts = match allowEts, denyEts with [||], [||] -> [|".*"|], [||] | x -> x - log.Information("Categories ☑️ {@allowCats} 🚫{@denyCats} Streams ☑️ {@allowStreams} 🚫{denyStreams} Events ☑️ {allowEts} 🚫{@denyEts}", - asRe allowCats, asRe denyCats, asRe allowSns, asRe denySns, asRe allowEts, asRe denyEts) + log.Value.Information("Categories ☑️ {@allowCats} 🚫{@denyCats} Streams ☑️ {@allowStreams} 🚫{denyStreams} Events ☑️ {allowEts} 🚫{@denyEts}", + asRe allowCats, asRe denyCats, asRe allowSns, asRe denySns, asRe allowEts, asRe denyEts) fun sn -> validCat sn && validStream sn diff --git a/tools/Propulsion.Tool/Sync.fs b/tools/Propulsion.Tool/Sync.fs index 145d78a3..878fc254 100644 --- a/tools/Propulsion.Tool/Sync.fs +++ b/tools/Propulsion.Tool/Sync.fs @@ -59,7 +59,6 @@ and Arguments(c, p: ParseResults) = | x -> p.Raise $"unexpected subcommand %A{x}" member val StatsInterval = TimeSpan.minutes 1 member val StateInterval = TimeSpan.minutes 5 - member val IdleDelay = TimeSpan.ms 10. and [] SourceParameters = | [] Cosmos of ParseResults | [] Dynamo of ParseResults @@ -243,7 +242,7 @@ let run appName (c: Args.Configuration, p: ParseResults) = async { let json = Propulsion.Codec.NewtonsoftJson.RenderedSpan.ofStreamSpan stream events |> Propulsion.Codec.NewtonsoftJson.Serdes.Serialize do! producer.ProduceAsync(FsCodec.StreamName.toString stream, json) |> Async.Ignore return Propulsion.Sinks.StreamResult.AllProcessed, Outcome.render_ stream ham spam 0 } - Propulsion.Sinks.Factory.StartConcurrent(Log.Logger, maxReadAhead, maxConcurrentProcessors, handle a.Filters.EventFilter, stats, idleDelay = a.IdleDelay) + Propulsion.Sinks.Factory.StartConcurrent(Log.Logger, maxReadAhead, maxConcurrentProcessors, handle a.Filters.EventFilter, stats) | SubCommand.Sync a -> let eventsContext = a.ConnectEvents() |> Async.RunSynchronously let stats = Propulsion.CosmosStore.CosmosStoreSinkStats(Log.Logger, statsInterval, stateInterval)