Verified Commit f44b078d authored by dockx thibault's avatar dockx thibault
Browse files

:ambulance: Fixes webService call namespace

Showing with 7 additions and 4 deletions
+7 -4
...@@ -145,8 +145,9 @@ class TaskGateway ...@@ -145,8 +145,9 @@ class TaskGateway
$this->unsetCountKeys($tasks); $this->unsetCountKeys($tasks);
if (!empty($tasks)) { if (!empty($tasks)) {
// Initiate the object webservice. // Initiate the object webservice.
$webservice = new WebServiceCall($_ENV['FUSION_DIRECTORY_API_URL'] . '/login', 'POST'); $webservice = new FusionDirectory\Rest\WebServiceCall($_ENV['FUSION_DIRECTORY_API_URL'] . '/login', 'POST');
// Required to prepare future webservice call. E.g. Retrieval of mandatory token. // Required to prepare future webservice call. E.g. Retrieval of mandatory token.
$webservice->setCurlSettings(); $webservice->setCurlSettings();
...@@ -186,21 +187,23 @@ class TaskGateway ...@@ -186,21 +187,23 @@ class TaskGateway
} }
break; break;
case 'Weekly' : case 'Weekly' :
if ($interval->d >= 7) { if ($interval->days >= 7) {
$result[$task['dn']]['result'] = $webservice->activateCyclicTasks($task['dn']); $result[$task['dn']]['result'] = $webservice->activateCyclicTasks($task['dn']);
} else { } else {
$result[$task['dn']]['lastExecFailed'] = 'This cyclic task has yet to reached its next execution cycle.'; $result[$task['dn']]['lastExecFailed'] = 'This cyclic task has yet to reached its next execution cycle.';
} }
break; break;
case 'Daily' : case 'Daily' :
if ($interval->d >= 1) { if ($interval->days >= 1) {
$result[$task['dn']]['result'] = $webservice->activateCyclicTasks($task['dn']); $result[$task['dn']]['result'] = $webservice->activateCyclicTasks($task['dn']);
} else { } else {
$result[$task['dn']]['lastExecFailed'] = 'This cyclic task has yet to reached its next execution cycle.'; $result[$task['dn']]['lastExecFailed'] = 'This cyclic task has yet to reached its next execution cycle.';
} }
break; break;
case 'Hourly' : case 'Hourly' :
if ($interval->h >= 1) { // When checking for hourly schedules, consider both the days and hours
$totalHours = $interval->days * 24 + $interval->h;
if ($totalHours >= 1) {
$result[$task['dn']]['result'] = $webservice->activateCyclicTasks($task['dn']); $result[$task['dn']]['result'] = $webservice->activateCyclicTasks($task['dn']);
} else { } else {
$result[$task['dn']]['lastExecFailed'] = 'This cyclic task has yet to reached its next execution cycle.'; $result[$task['dn']]['lastExecFailed'] = 'This cyclic task has yet to reached its next execution cycle.';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment