在芹菜中一对一地处理消息

时间:2019-06-14 19:08:04

标签: celery

我的launch.json中有此celery的配置(我正在linux docker上运行它):

{
    "name": "Python: Celery",
    "type": "python",
    "request": "launch",
    "module": "celery",
    "console": "integratedTerminal",
    "args": [
        "-A",
        "celery_worker",
        "worker",
        "-Q",
        "test pipeline *** collect BB",
        "--concurrency=1",
        "-l",
        "info",
        "-P",
        "solo",
    ]
},

我将文档中提到的设置为“ --concurrency = 1”。

例如,当我向RabbitMq代理发送4条消息,激活工作程序,在处理该消息的函数的开头的条目中放置断点,然后在发送回响应之前终止程序时,我看到所有4条消息消息是RabbitMq中的Nack,我希望只有1条消息是Nack

1 个答案:

答案 0 :(得分:0)

为了实现所需的行为,必须确保two settings are set

$('.start-time-monday').each(function(){
    $(this).change(function(){

        var monTime = 


        $('.start-time-monday').each(function(){
        $(this).change(function(){

                var monTime = $('.start-time-monday option:selected').text();
                var value = "";

            switch(monTime){
              case "7:00 am":
                value = 7.00;
                        break;
              case "7:15 am":
                value = 7.25;
                        break;
              case "7:30 am":
                value = 7.50;
                        break;
              case "7:45 am":
                value = 7.75;
                        break;
              case "8:00 am":
                value = 8.00;
                        break;
              case "8:15 am":
                value = 8.25;
                        break;
              case "8:30 am":
                value = 8.50;
                        break;
              case "8:45 am":
                value = 8.75;
                        break;
              case "9:00 am":
                value = 9.00;
                        break;
              case "9:15 am":
                value = 9.25;
                        break;
              case "9:30 am":
                value = 9.50;
                        break;
              case "9:45 am":
                value = 9.75;
                        break;
              case "10:00 am":
                value = 10.00;
                        break;
              case "10:15 am":
                value = 10.25;
                        break;
              case "10:30 am":
                value = 10.50;
                        break;
              case "10:45 am":
                value = 10.75;
                        break;
              case "11:00 am":
                value = 11.00;
                        break;
              case "11:15 am":
                value = 11.25;
                        break;
              case "11:30 am":
                value = 11.50;
                        break;
              case "11:45 am":
                value = 11.75;
                        break;
              case "12:00 pm":
                value = 12.00;
                        break;
              case "12:15 pm":
                value = 12.25;
                        break;
              case "12:30 pm":
                value = 12.50;
                        break;
              case "12:45 pm":
                value = 12.75;
                        break;
              case "1:00 pm":
                value = 13.00;
                        break;
              case "1:15 pm":
                value = 13.25;
                        break;
              case "1:30 pm":
                value = 13.50;
                        break;
              case "1:45 pm":
                vaue = 13.75;
                        break;
              case "2:00 pm":
                value = 14.00;
                        break;
              case "2:15 pm":
                value = 14.25;
                        break;
              case "2:30 pm":
                value = 14.50;
                        break;
              case "2:45 pm":
                value = 14.75;
                        break;
              case "3:00 pm":
                value = 15.00;
                        break;
              case "3:15 pm":
                value = 15.25;
                        break;
              case "3:30 pm":
                value = 15.50;
                        break;
              case "3:45 pm":
                value = 15.75;
                        break;
              case "4:00 pm":
                value = 16.00;
                        break;
              case "4:15 pm":
                value = 16.25;
                        break;
              case "4:30 pm":
                value = 16.50;
                        break;
              case "4:45 pm":
                value = 16.75;
                        break;
              case "5:00 pm":
                value = 17.00;
                        break;
              case "5:15 pm":
                value = 17.25;
                        break;
              case "5:30 pm":
                value = 17.50;
                        break;
              case "5:45 pm":
                value = 17.75;
                        break;
              case "6:00 pm":
                value = 18.00;
                        break;
              case "6:15 pm":
                value = 18.25;
                        break;
              case "6:30 pm":
                value = 18.50;
                        break;
              case "6:45 pm":
                value = 18.75;
                        break;
              case "7:00 pm":
                value = 19.00;
                        break;
              case "7:15 pm":
                value = 19.25;
                        break;
              case "7:30 pm":
                value = 19.50;
                        break;
              case "7:45 pm":
                value = 19.75;
                        break;
                    default:
                      value = '0';
                        break;
              }

          //var startTimeMon = timeSwitch(monTime) ;
          console.log(value, 'Monday Start time value');
        });

  });


    $('.meal-break-monday').each(function(){
    $(this).change(function(){

            var breakMonTime = $('.meal-break-monday option:selected').text();
            var breakMonvalue = "";

        switch(breakMonTime){
          case "15 mins":
            breakMonvalue = 0.25;
                    break;
          case "30 mins":
            breakMonvalue = 0.50;
                    break;
          case "45 mins":
            breakMonvalue = 0.75;
                    break;
          case "60 mins":
            breakMonvalue = 1.00;
                    break;
                default:
                  value = '0';
                    break;
          }

      //var startTimeMon = timeSwitch(monTime) ;
      console.log(breakMonvalue, 'Mon BREAK time value');
    });


});





//finish time monday
  $('.finish-time-monday').each(function(){
    $(this).change(function(){

            var finishMonTime = $('.finish-time-monday option:selected').text();
            var finishMonvalue = "";

        switch(finishMonTime){
          case "7:00 am":
            finishMonvalue = 7.00;
                    break;
          case "7:15 am":
            finishMonvalue = 7.25;
                    break;
          case "7:30 am":
            finishMonvalue = 7.50;
                    break;
          case "7:45 am":
            finishMonvalue = 7.75;
                    break;
          case "8:00 am":
            finishMonvalue = 8.00;
                    break;
          case "8:15 am":
            finishMonvalue = 8.25;
                    break;
          case "8:30 am":
            finishMonvalue = 8.50;
                    break;
          case "8:45 am":
            finishMonvalue = 8.75;
                    break;
          case "9:00 am":
            finishMonvalue = 9.00;
                    break;
          case "9:15 am":
            finishMonvalue = 9.25;
                    break;
          case "9:30 am":
            finishMonvalue = 9.50;
                    break;
          case "9:45 am":
            finishMonvalue = 9.75;
                    break;
          case "10:00 am":
            finishMonvalue = 10.00;
                    break;
          case "10:15 am":
            finishMonvalue = 10.25;
                    break;
          case "10:30 am":
            finishMonvalue = 10.50;
                    break;
          case "10:45 am":
            finishMonvalue = 10.75;
                    break;
          case "11:00 am":
            finishMonvalue = 11.00;
                    break;
          case "11:15 am":
            finishMonvalue = 11.25;
                    break;
          case "11:30 am":
            finishMonvalue = 11.50;
                    break;
          case "11:45 am":
            finishMonvalue = 11.75;
                    break;
          case "12:00 pm":
            finishMonvalue = 12.00;
                    break;
          case "12:15 pm":
            finishMonvalue = 12.25;
                    break;
          case "12:30 pm":
            finishMonvalue = 12.50;
                    break;
          case "12:45 pm":
            finishMonvalue = 12.75;
                    break;
          case "1:00 pm":
            finishMonvalue = 13.00;
                    break;
          case "1:15 pm":
            finishMonvalue = 13.25;
                    break;
          case "1:30 pm":
            finishMonvalue = 13.50;
                    break;
          case "1:45 pm":
            finishMonvaue = 13.75;
                    break;
          case "2:00 pm":
            finishMonvalue = 14.00;
                    break;
          case "2:15 pm":
            finishMonvalue = 14.25;
                    break;
          case "2:30 pm":
            finishMonvalue = 14.50;
                    break;
          case "2:45 pm":
            finishMonvalue = 14.75;
                    break;
          case "3:00 pm":
            finishMonvalue = 15.00;
                    break;
          case "3:15 pm":
            finishMonvalue = 15.25;
                    break;
          case "3:30 pm":
            finishMonvalue = 15.50;
                    break;
          case "3:45 pm":
            finishMonvalue = 15.75;
                    break;
          case "4:00 pm":
            finishMonvalue = 16.00;
                    break;
          case "4:15 pm":
            finishMonvalue = 16.25;
                    break;
          case "4:30 pm":
            finishMonvalue = 16.50;
                    break;
          case "4:45 pm":
            finishMonvalue = 16.75;
                    break;
          case "5:00 pm":
            finishMonvalue = 17.00;
                    break;
          case "5:15 pm":
            finishMonvalue = 17.25;
                    break;
          case "5:30 pm":
            finishMonvalue = 17.50;
                    break;
          case "5:45 pm":
            finishMonvalue = 17.75;
                    break;
          case "6:00 pm":
            finishMonvalue = 18.00;
                    break;
          case "6:15 pm":
            finishMonvalue = 18.25;
                    break;
          case "6:30 pm":
            finishMonvalue = 18.50;
                    break;
          case "6:45 pm":
            finishMonvalue = 18.75;
                    break;
          case "7:00 pm":
            finishMonvalue = 19.00;
                    break;
          case "7:15 pm":
            finishMonvalue = 19.25;
                    break;
          case "7:30 pm":
            finishMonvalue = 19.50;
                    break;
          case "7:45 pm":
            value = 19.75;
                    break;
                default:
                  value = '0';
                    break;
          }

      //var startTimeMon = timeSwitch(monTime) ;
      console.log(finishMonvalue, 'Mon FINISH time value');
    });


});