public async Task <int> ExecuteAsync( CancellationToken cancellationToken = default(CancellationToken)) { TRepositoryFactory repoFactory = default(TRepositoryFactory); try { repoFactory = CreateRepositoryFactoryCallback(Configuration); BlockchainProcessor processor = CreateBlockChainProcessor(repoFactory); if (TargetConfiguration.ToBlock != null) { await processor.ExecuteAsync(TargetConfiguration.ToBlock.Value, cancellationToken, TargetConfiguration.FromBlock); } else { await processor.ExecuteAsync(cancellationToken, TargetConfiguration.FromBlock); } return(0); } catch (Exception ex) { log?.Error(ex); if (repoFactory != null) { DisposeAction?.Invoke(repoFactory); } return(1); } }
public void Dispose() { if (!IsSingletone && Result is IDisposable disposable) { disposable.Dispose(); } DisposeAction?.Invoke(); }
public void Dispose() { DisposeAction.Invoke(); DisposableLock.Dispose(); }
public void Dispose() => _dispose?.Invoke(value: _value, explicitDispose: true);