summaryrefslogtreecommitdiffstats
path: root/modules-available/minilinux
diff options
context:
space:
mode:
authorSimon Rettberg2023-07-25 10:15:42 +0200
committerSimon Rettberg2023-07-25 10:15:42 +0200
commitfe3da625b61c4a2fcec261f397fc818bcbc7353c (patch)
tree579b9c2ce12642e8e7b35916ba6bafd63a36374a /modules-available/minilinux
parent[inc/Eventlog] Make sure data fits in columns (diff)
downloadslx-admin-fe3da625b61c4a2fcec261f397fc818bcbc7353c.tar.gz
slx-admin-fe3da625b61c4a2fcec261f397fc818bcbc7353c.tar.xz
slx-admin-fe3da625b61c4a2fcec261f397fc818bcbc7353c.zip
[minilinux] Better error handling if list download fails
Diffstat (limited to 'modules-available/minilinux')
-rw-r--r--modules-available/minilinux/inc/minilinux.inc.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules-available/minilinux/inc/minilinux.inc.php b/modules-available/minilinux/inc/minilinux.inc.php
index 47d14a86..44e8bacb 100644
--- a/modules-available/minilinux/inc/minilinux.inc.php
+++ b/modules-available/minilinux/inc/minilinux.inc.php
@@ -54,15 +54,16 @@ class MiniLinux
*/
public static function listDownloadCallback($task, $sourceid)
{
- if ($task['statusCode'] !== 'TASK_FINISHED')
+ if (!Taskmanager::isFinished($task))
return;
$taskId = $task['id'];
$data = json_decode($task['data']['content'], true);
- if (!is_array($data)) {
- EventLog::warning('Cannot download Linux version meta data for ' . $sourceid);
+ if (!is_array($data) || empty($data['systems'])) {
+ EventLog::warning('Cannot download Linux version meta data for ' . $sourceid,
+ ($task['data']['error'] ?? '') . "\n\nContent:\n" . $task['data']['content']);
$lastupdate = 'lastupdate';
} else {
- if (@is_array($data['systems'])) {
+ if (is_array($data['systems'])) {
self::addBranches($sourceid, $data['systems']);
}
$lastupdate = 'UNIX_TIMESTAMP()';