fixes on the curate job
This commit is contained in:
@@ -61,7 +61,7 @@ class CurateJobs extends Command
|
|||||||
$body .= 'RETURN ONLY VALID JSON, NO TEXT BEFORE OR AFTER THE JSON!';
|
$body .= 'RETURN ONLY VALID JSON, NO TEXT BEFORE OR AFTER THE JSON!';
|
||||||
|
|
||||||
// Make POST request to API with job name and description
|
// Make POST request to API with job name and description
|
||||||
$response = Http::timeout(130)
|
$response = Http::timeout(300)
|
||||||
->withHeaders([
|
->withHeaders([
|
||||||
'Accept' => 'application/json',
|
'Accept' => 'application/json',
|
||||||
'CF-Access-Client-Id' => '8c4cc272c7f08f8d7911a28eb5d7db44.access',
|
'CF-Access-Client-Id' => '8c4cc272c7f08f8d7911a28eb5d7db44.access',
|
||||||
@@ -76,7 +76,13 @@ class CurateJobs extends Command
|
|||||||
|
|
||||||
$responseArray = $response->json();
|
$responseArray = $response->json();
|
||||||
$responseTagsJson = $responseArray['response'];
|
$responseTagsJson = $responseArray['response'];
|
||||||
|
Log::info("Curated job id: {$responseArray['job_id']} Result: {$responseTagsJson}");
|
||||||
$tags = json_decode($responseTagsJson, true);
|
$tags = json_decode($responseTagsJson, true);
|
||||||
|
|
||||||
|
if (empty($tags) || $tags === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$tags = array_flip($tags);
|
$tags = array_flip($tags);
|
||||||
|
|
||||||
if (is_array($tags) && !empty($tags)) {
|
if (is_array($tags) && !empty($tags)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user