Пример #1
0
        public string Voice2TextFailed(bool requeueAsTheLast, [FromBody] Voice2Text task)
        {
            using (HlidacStatu.Q.Simple.Queue <Voice2Text> sq
                       = new Q.Simple.Queue <Voice2Text>(Voice2Text.QName + "_failed", Devmasters.Config.GetWebConfigValue("RabbitMqConnectionString")))
            {
                sq.Send(task);
            }

            return("OK");
        }
Пример #2
0
        public string Voice2TextDone([FromBody] Voice2Text task)
        {
            using (HlidacStatu.Q.Simple.Queue <Voice2Text> sq
                       = new Q.Simple.Queue <Voice2Text>(Voice2Text.QName + "_done", Devmasters.Config.GetWebConfigValue("RabbitMqConnectionString")))
            {
                task.internaltaskid = 0;
                sq.Send(task);
            }


            return($"OK");
        }
Пример #3
0
 public string Voice2TextNewTask(string datasetId, string itemId, int priority = 0)
 {
     using (HlidacStatu.Q.Simple.Queue <Voice2Text> sq = new Q.Simple.Queue <Voice2Text>(
                Voice2Text.QName_priority(priority),
                Devmasters.Config.GetWebConfigValue("RabbitMqConnectionString"))
            )
     {
         sq.Send(new Voice2Text()
         {
             dataset = datasetId, itemid = itemId
         });
         return($"OK");
     }
 }
Пример #4
0
        public string Voice2TextFailed(bool requeueAsTheLast, [FromBody] Voice2Text task)
        {
            using (HlidacStatu.Q.Simple.Queue <TaskResult <Voice2Text> > sq
                       = new Q.Simple.Queue <TaskResult <Voice2Text> >(Voice2Text.QName_failed, Devmasters.Config.GetWebConfigValue("RabbitMqConnectionString")))
            {
                TaskResult <Voice2Text> result = new TaskResult <Voice2Text>()
                {
                    Payload = task,
                    Created = DateTime.Now,
                    Result  = "failed",
                    User    = this.ApiAuth?.ApiCall?.User,
                    FromIP  = this.HostIpAddress
                };
                sq.Send(result);
            }

            return("OK");
        }