HERE API从不运行批处理作业,始终返回接受状态 [英] HERE API never runs batch job, always returns accepted status

查看:93
本文介绍了HERE API从不运行批处理作业,始终返回接受状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,我的应用程序今天早上停止工作。提交作业后,在请求其状态时,它仅返回接受的

For some reason my application stopped working this morning. After submitting a job, when making a request for it's status, it only returns accepted

这是我的代码m用于创建和运行作业:

Here's the code I'm using to create and run the job:

$url = "https://batch.geocoder.api.here.com/6.2/jobs?action=run&app_code=".$app_code."&app_id=".$app_id."&mailto=stackoverflow@example.com&outcols=latitude,longitude,locationLabel&outputcombined=true&indelim=|&outdelim=|&language=hu-HU&header=true";
    if($cURLHandler) {
        curl_setopt($cURLHandler, CURLOPT_HTTPHEADER, array('Content-Type: text/plain'));
        curl_setopt($cURLHandler, CURLOPT_BINARYTRANSFER, true);
        curl_setopt($cURLHandler, CURLOPT_POST, true);
        curl_setopt($cURLHandler, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($cURLHandler, CURLOPT_POSTFIELDS, file_get_contents($userFolderURL."/batchjob.txt"));
        curl_setopt($cURLHandler, CURLOPT_URL, $url);

        $cURLResults = curl_exec($cURLHandler);

        curl_close($cURLHandler);
    }

这是示例batchjob.txt的内容:

This is the content of an example batchjob.txt:

recId|searchText|country
1|"2120 Dunakeszi Barátság útja 18"|HUN
2|"2120 Dunakeszi Barátság útja 18"|HUN
3|"2120 Dunakeszi Baràtsàg útja 12"|HUN
4|"2120 Dunakeszi Barátság utja 49"|HUN
5|"2120 Dunakeszi Barátság útja 3"|HUN
6|"2120 Dunakeszi Barátság útja.30"|HUN
7|"2120 Dunakeszi Bátorkeszi utca 7."|HUN
8|"2120 Dunakeszi bercsényi u 27"|HUN
9|"2120 Dunakeszi Déli utca 12."|HUN

创建并运行作业后,我检查了并通过以下cURL请求每10秒更改一次状态:

After creating and running a job I check it's status every 10 seconds with the following cURL request:

$url = "https://batch.geocoder.api.here.com/6.2/jobs/".$requestID."?action=status&app_code=".$app_code."&app_id=".$app_id;

$ch = curl_init();
if($ch) {
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain'));
    curl_setopt($ch, CURLOPT_HTTPGET, true);
    curl_setopt($ch, CURLOPT_URL, $url);
    $result = curl_exec($ch);
    curl_close($ch);
}

但是它总是返回以下xml:

But it always returns the following xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:SearchBatch xmlns:ns2="http://www.navteq.com/lbsp/Search-Batch/1"><Response><MetaInfo><RequestId>REQUESTID ommited</RequestId></MetaInfo><Status>accepted</Status><TotalCount>0</TotalCount><ValidCount>0</ValidCount><InvalidCount>0</InvalidCount><ProcessedCount>0</ProcessedCount><PendingCount>0</PendingCount><SuccessCount>0</SuccessCount><ErrorCount>0</ErrorCount></Response></ns2:SearchBatch>

我仔细检查了一下,我的应用代码&应用程序ID均有效,因此我真的不知道发生这种情况的原因。

I double checked, my app code & app id are both valid, so I really don't see the reason to why this is happening.

根据官方文档,我的第一个cURL请求应创建&开始工作,但是由于某种原因,它似乎从来没有做过?这里可能是什么问题?

According to the official docs, my 1st cURL request should create & start the job, however for some reason it seems that it never does? What may be the issue here?

推荐答案

状态为已接受表示您的工作已排队并且正在等待某个时段执行。我们在这里正在监视队列,以确保根据需要调整容量。

Status "accepted" means that your job has been queued and is waiting for a slot to execute. We at HERE are monitoring the queues to make sure that capacity is adjusted as needed.

所以我想您的应用程序还可以,并且瓶颈可能就在我们这边。

So I guess that your application is ok and the bottleneck was probably on our side.

这篇关于HERE API从不运行批处理作业,始终返回接受状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆