public LbRemoveRequestFromQueueResponse RemoveRequestFromQueue(LbRemoveRequestFromQueueRequest request) { try { Log.Debug(this, "RemoveRequestFromQueue()"); Authenticate(request); LbRemoveRequestFromQueueResponse response = new LbRemoveRequestFromQueueResponse(); var req = Database.GetInstance().RequestQueue.Find(x => x.Id == request.RequestId); if (req != null) { Database.GetInstance().RequestQueue.Remove(req); response.Removed = true; DecrementRequestCount(req.NodeId, req.ApplicationId, req.InstanceId); Log.Debug(this, "Removed request from queue: " + request.RequestId + " - " + req.Url); } else { Log.Debug(this, "Could not find request in queue: " + request.RequestId); } return response; } catch (Exception e) { Log.Error(this, e); throw e; } }
private void RemoveRequestFromQueue(int requestId) { try { LbRemoveRequestFromQueueRequest request = new LbRemoveRequestFromQueueRequest(Settings.Credentials); request.RequestId = requestId; EndPoints.LoadBalancerWebService.RemoveRequestFromQueue(request); } catch (Exception e) { Log.Error(this, "RemoveRequestFromQueue() failed: ", e); } }