Skip to content

Commit 0419548

Browse files
authored
Add check for services in maintenance mode (#51)
Solves #49
1 parent 1a310a4 commit 0419548

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/OpencastApi/Opencast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private function setIngestProperty($config)
195195
if (is_array($service)) {
196196
// Filter running ingest services.
197197
$running_services = array_filter($service, function ($s) {
198-
return $s->active && $s->online;
198+
return $s->active && $s->online && !$s->maintenance;
199199
});
200200
// If no running services, return.
201201
if (empty($running_services)) {
@@ -205,7 +205,7 @@ private function setIngestProperty($config)
205205
$ingestService = reset($running_services);
206206
} else {
207207
// There is only one and is running.
208-
if (!($service->active && $service->online)) {
208+
if (!($service->active && $service->online && !$service->maintenance)) {
209209
return;
210210
}
211211
$ingestService = $service;

0 commit comments

Comments
 (0)