public void OnExceptionIsExecutedWhenApiResultHasException() { Logger logger = new Logger(); ExceptionArgs exceptionArgs = null; FlushLogArgs flushArgs = FlushLogArgsFactory.Create(new[] { logger }); CreateRequestLogRequest request = PayloadFactory.Create(flushArgs); var kisslogApi = new Mock <IPublicApi>(); kisslogApi.Setup(p => p.CreateRequestLog(It.IsAny <CreateRequestLogRequest>(), It.IsAny <IEnumerable <File> >())) .Returns(new ApiResult <RequestLog> { Exception = new ApiException { ErrorMessage = $"Error {Guid.NewGuid()}" } }); FlushOptions options = new FlushOptions { UseAsync = false, OnException = (ExceptionArgs args) => { exceptionArgs = args; } }; Flusher.FlushAsync(options, kisslogApi.Object, flushArgs, request).ConfigureAwait(false); Assert.IsNotNull(exceptionArgs); }
public SingleColumnFamilyAdapter(string name, RocksDbSharp.RocksDb db, WriteOptions writeOptions, Func <byte[], byte[], int> keyComparator, ColumnFamilyHandle columnFamilyHandle) { this.name = name; this.db = db; this.writeOptions = writeOptions; this.keyComparator = keyComparator; this.columnFamilyHandle = columnFamilyHandle; flushOptions = new(); flushOptions.SetWaitForFlush(true); }
public void Flush(FlushOptions options) { var input = new InitializeInput(_settings); if (options == FlushOptions.Wipeout) { input.ForceFlag = true; } new InitializeCommand().Execute(input); writeEnvironmentSettings(); _recipes.Each(writeRecipe); }