1
$jobs = $jq->getJobsList(array(
'status' => ZendJobQueue::STATUS_RUNNING
);

尽管有多个进程正在运行,但上面的代码返回空结果(我可以使用 zend 服务器用户界面看到它)。从 int 0 开始的状态列表

const int STATUS_PENDING;
const int STATUS_WAITING_PREDECESSOR;
const int STATUS_RUNNING;
const int STATUS_COMPLETED;
const int STATUS_FAILED;
const int STATUS_OK;
const int STATUS_LOGICALLY_FAILED;
const int STATUS_TIMEOUT;
const int STATUS_REMOVED;
const int STATUS_SCHEDULED;
const int STATUS_SUSPENDED

; 但是当我运行一个进程时,如果我立即检查

$jobs = $jq->getJobsList(array(
    'status' => ZendJobQueue::STATUS_FAILED
    );

那又给出了错误的结果

Array
(
    [0] => Array
        (
            [id] => 266
            [type] => 1
            [node_id] => 0
            [queue_name] => 
            [status] => 2//look this status it is for running process as of documentation
            [priority] => 1
            [persistent] => 
            [script] => http://localhost:3030/feecalc/index.php?job=runFeecalc
            [predecessor] => 0
            [name] => 1
            [vars] => {"session_code":"20124 ","user_id":"70"}
            [http_headers] => 
            [output] => 
            [error] => 
            [start_time] => 2013-09-06 12:37:31
            [creation_time] => 2013-09-06 12:37:31
            [end_time] => 
            [schedule] => 
            [schedule_time] => 
            [schedule_id] => 0
            [app_id] => -1
        )

)

我正在使用 zend 企业版 6(试用版)

有没有人有解决方案?

4

1 回答 1

1

我已经联系了 Zend 人员,所以我会将回复粘贴为答案。

实际上,文档对此并不太清楚,但是您需要使用以“JOB_STATUS_”前缀开头的类常量,因此在您的情况下,请执行以下操作:

$jobs = $jq->getJobsList(array(
'status' => ZendJobQueue::JOB_STATUS_RUNNING
);
于 2013-09-10T06:43:52.037 回答