Exemplo n.º 1
0
        private void ProcessSubmission <TInput, TResult>(OjsSubmission <TInput> submission)
            where TResult : ISingleCodeRunResult, new()
        {
            this.logger.Information("{SubmissionProcessor}: Work on submission {Submission} started.", this.Name, submission.Id);

            this.hubService.NotifyServer(new SrServerNotification()
            {
                Type         = SrServerNotificationType.StartedProcessing,
                SubmissionId = (int)submission.Id
            });

            this.BeforeExecute(submission);

            var executor = new SubmissionExecutor(this.portNumber);

            var executionResult = executor.Execute <TInput, TResult>(submission);

            this.logger.Information("{SubmissionProcessor}: Work on submission {Submission} ended.", this.Name, submission.Id);

            this.hubService.NotifyServer(new SrServerNotification()
            {
                Type         = SrServerNotificationType.FinishedProcessing,
                SubmissionId = (int)submission.Id
            });

            this.ProcessExecutionResult(executionResult, submission);

            this.logger.Information("{SubmissionProcessor}: Submission {Submission} was processed successfully.", this.Name, submission.Id);
        }
        private void ProcessSubmission <TInput, TResult>(OjsSubmission <TInput> submission)
            where TResult : ISingleCodeRunResult, new()
        {
            this.logger.Info($"Work on submission #{submission.Id} started.");

            this.BeforeExecute(submission);

            var executor = new SubmissionExecutor(this.portNumber);

            var executionResult = executor.Execute <TInput, TResult>(submission);

            this.logger.Info($"Work on submission #{submission.Id} ended.");

            this.ProcessExecutionResult(executionResult, submission);

            this.logger.Info($"Submission #{submission.Id} successfully processed.");
        }