Esempio n. 1
0
 protected virtual void FreeResources(ICheckoutTaskContext context, CheckoutTask task)
 {
     task.ProxyPool.Release(task.Proxy);
     task.Proxy = null;
     context?.Dispose();
     TierControl.Release();
 }
Esempio n. 2
0
        private bool IsCanceled(CancellationToken cancelToken, CheckoutTask task, ICheckoutTaskContext context = null, bool isTierAcquired = true)
        {
            bool ret = false;

            if (cancelToken.IsCancellationRequested)
            {
                task.State = CheckoutTaskState.Canceled;
                context?.Dispose();
                if (isTierAcquired)
                {
                    TierControl.Release();
                }
                Logger.LogEvent(task.Log, $"TASK {task.Id}", "Task is canceled!");
                ret = true;
            }

            return(ret);
        }