public void JobFinished(HttpJob httpJob) { lock (HttpJobs) { HttpJobs.Remove(httpJob); } }
internal void DoJob(HttpJob httpJob) { try { httpJob.DoWork(); } catch (Exception exception) { httpJob.Error = exception; LogInfo("Listener exception: " + exception); } finally { httpJob.EndTimeOrDateTimeMax = DateTime.Now; //httpJob.EndTimeOrDateTimeMax = DateTime.Now; lock (HttpJobs) { HttpJobs.Remove(httpJob); } } }
internal void _listener_404(IHttpClientContext context, IHttpRequest request, IHttpResponse response) { HttpJob httpJob = new HttpJob(this, context, request, response); lock (HttpJobs) { HttpJobs.Add(httpJob); } // 5 second wait if (Monitor.TryEnter(HttpLock, waitForEachTime)) { DoJob(httpJob); Monitor.Exit(HttpLock); } else { LogInfo("ERROR Waiting for prevoius request more than " + TaskQueueHandler.GetTimeString(waitForEachTime)); httpJob.OutOfLock = true; DoJob(httpJob); } }