/// <summary>
        /// Jobs added here are executed in the next loop (when no restrictions apply).
        /// </summary>
        /// <returns>task which resolves when job is started to true, otherwise (e.g. restrictions) to false</returns>
        /// <remarks>Job needs to exist in Job list already.</remarks>
        public Task <QuickStartResult> QuickStart(string jobKey, CancellationToken cancellationToken = default)
        {
            var quickStartRequest = new QuickStartRequest(jobKey, cancellationToken);

            QuickStartQueue.Enqueue(quickStartRequest);
            return(quickStartRequest.CompletionTask);
        }
Beispiel #2
0
 public IActionResult Post([FromBody] QuickStartRequest request)
 {
     try
     {
         var response = DiProvider.GetContainer().GetInstance <QuickStartReceiver>().Receive(request);
         return(Ok(response));
     }
     catch (Exception ex)
     {
         FileHelper.WriteLine(ex.ToString());
         throw ex;
     }
 }