From 04a47e9c2825b48ab89af29c790fff7e3d8d4313 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 24 May 2023 17:12:41 +0200 Subject: [dozmod] Cleanup of api.inc.php --- modules-available/dozmod/api.inc.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules-available/dozmod/api.inc.php b/modules-available/dozmod/api.inc.php index 6b9d68c8..17298bb7 100644 --- a/modules-available/dozmod/api.inc.php +++ b/modules-available/dozmod/api.inc.php @@ -17,7 +17,7 @@ if (!Module::isAvailable('locations')) { define('LIST_URL', CONFIG_DOZMOD_URL . '/vmchooser/list'); define('VMX_URL', CONFIG_DOZMOD_URL . '/vmchooser/lecture'); -$availableRessources = ['list', 'vmx', 'netrules', 'runscript', 'metadata', 'netshares','imagemeta']; +$availableRessources = ['list', 'netrules', 'metadata', 'imagemeta']; /* BEGIN: A simple caching mechanism ---------------------------- */ @@ -71,7 +71,7 @@ function cache_get_passthru($key) fpassthru($fp); exit; } - error_log('Cannot passthrough cache file ' . $filename); + error_log('DMSD-cache: Cannot passthrough cache file ' . $filename); } /* END: Cache ---------------------------------------------------- */ @@ -79,7 +79,7 @@ function cache_get_passthru($key) /* this script requires 2 (3 with implicit client ip) parameters * -* resource = vmx,... +* resource = list,metadata,... * lecture_uuid = client can choose **/ @@ -186,7 +186,7 @@ function getListForLocations($locationIds, $raw) $value = Download::asString($url, 60, $code); $t = microtime(true) - $t; if ($t > 5) { - error_log("Download of lecture list took $t ($code)"); + error_log("DMSD-cache: Download of lecture list took $t ($code)"); } if ($value === false || $code < 200 || $code > 299) return false; @@ -219,10 +219,12 @@ function _getVmData($lecture_uuid, $subResource = false) $response = Download::asString($url, 60, $code); $t = microtime(true) - $t; if ($t > 5) { - error_log("Download of $subResource took $t ($code)"); + error_log("DMSD-cache: Download of $subResource took $t ($code)"); } - if ($code < 200 || $code > 299) + if ($code < 200 || $code > 299) { + error_log("DMSD-cache: Return code $code, payload len " . strlen($response)); return (int)$code; + } return $response; } -- cgit v1.2.3-55-g7522