HireFire端点间歇性返回500

时间:2019-03-15 06:10:26

标签: heroku celery flask-restful hirefire

我正在使用HIreFire自动缩放我的工人测功机。我正在使用Python 3.4。 HireFire端点间歇性出现500错误

HireFire==0.8
gunicorn==19.9.0
Flask==1.0.2
Flask-RESTful==0.3.7

Celery WorkerProc的配置如下:

def make_celery():
    """
    Generate celery instance object
    Returns:
        Celery instance object
    """
    celery_app = Celery('worker',
                        backend='rpc://',
                        include=['worker.tasks'])
    celery_app.config_from_object('configuration.celery_config')

    return celery_app


app = make_celery()

class Worker1Proc(CeleryProc):
    name = 'worker1'
    queues = os.environ.get("WORKER1_QUEUES").split(',')
    simple_queues = True

class Worker2Proc(CeleryProc):
    name = 'worker2'
    queues = os.environ.get("WORKER2_QUEUES").split(',')
    simple_queues = True

class Worker3Proc(CeleryProc):
    name = 'worker3'
    queues = os.environ.get("WORKER3_QUEUES").split(',')
    simple_queues = True

使用Flask的HireFire API的设置如下:

import os

from flask import Flask
from hirefire.contrib.flask.blueprint import build_hirefire_blueprint

app = Flask(__name__)
bp = build_hirefire_blueprint(os.environ['HIREFIRE_TOKEN'],
                              ['worker.celery.Worker1Proc',
                               'worker.celery.Worker2Proc',
                               'worker.celery.Worker3Proc'])
app.register_blueprint(bp)

此端点间歇地给出:

  

“无法获取作业队列。发生未知错误。请联系支持   如果此问题仍然存在。“

在日志中,我看到了这些

TypeError: get_inspect_value() missing 1 required positional argument: 'method'
TypeError: get_status_task_counts() missing 1 required positional argument: 'status'```

0 个答案:

没有答案