summaryrefslogtreecommitdiffstats
path: root/modules-available/dozmod
diff options
context:
space:
mode:
authorSimon Rettberg2023-05-24 17:12:41 +0200
committerSimon Rettberg2023-05-24 17:12:41 +0200
commit04a47e9c2825b48ab89af29c790fff7e3d8d4313 (patch)
tree4edc9df469abce34fef70eda240c14a3d267fa5d /modules-available/dozmod
parent[inc/Mailer] Add comments (diff)
downloadslx-admin-04a47e9c2825b48ab89af29c790fff7e3d8d4313.tar.gz
slx-admin-04a47e9c2825b48ab89af29c790fff7e3d8d4313.tar.xz
slx-admin-04a47e9c2825b48ab89af29c790fff7e3d8d4313.zip
[dozmod] Cleanup of api.inc.php
Diffstat (limited to 'modules-available/dozmod')
-rw-r--r--modules-available/dozmod/api.inc.php14
1 files 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;
}