ZEND作业队列api返回空结果

时间:2013-09-06 06:33:24

标签: zend-framework zend-server

$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(试用版)

有没有人有解决方案?

1 个答案:

答案 0 :(得分:1)

我已与Zend人员联系,因此我会将回复粘贴为答案。

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

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