public virtual void ProcessBatch(OcrBatch batch) { try { mutex.WaitOne(); PreProcessVouchers(a2iAOcrService); foreach (VoucherType voucher in Enum.GetValues(typeof(VoucherType))) { ProcessVouchers(batch.Vouchers, voucher); } a2iAOcrService.CloseOcrChannel(); } catch (Exception) { { } throw; } finally { mutex.ReleaseMutex(); OnBatchComplete(this, batch.JobIdentifier); } }
private void CloseChannel(A2iAOcrService service) { var timeSpan = (int)TimeSpan.FromMinutes(stickyChannelTimeout).TotalMilliseconds; if (batchProcessing) { StartStickyConnection(CloseChannel, service, timeSpan, cancellationTokenSource.Token); } else { service.CloseOcrChannel(); } }
private void CloseChannel(A2iAOcrService service) { var timeSpan = (int)TimeSpan.FromMinutes(stickyChannelTimeout).TotalMilliseconds; if (batchProcessing) StartStickyConnection(CloseChannel, service, timeSpan, cancellationTokenSource.Token); else service.CloseOcrChannel(); }