Skip to content

Commit

Permalink
Another fix for when an instance is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
austinwbest committed Dec 28, 2024
1 parent 42e5f2b commit a8ab6cc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions root/app/www/public/pages/starr.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@

$test = $starr->testConnection($app, $starrInstance['url'], $starrInstance['apikey']);
$version = $test['responseHeaders']['X-Application-Version'][0];
$branch = $version && is_array($test) && is_array($test['response']) ? $test['response']['branch'] : '';
$branch = '';

if ($test['response']['instanceName'] != $starrInstance['name']) {
$proxyDb->updateStarrAppSetting($starrInstance['id'], 'name', $test['response']['instanceName']);
$starrInstance['name'] = $test['response']['instanceName'];
if ($version && is_array($test) && is_array($test['response'])) {
$branch = $test['response']['branch'];

if ($test['response']['instanceName'] != $starrInstance['name']) {
$proxyDb->updateStarrAppSetting($starrInstance['id'], 'name', $test['response']['instanceName']);
$starrInstance['name'] = $test['response']['instanceName'];
}
}

$instanceDown = !$version ? true : false;
Expand Down

0 comments on commit a8ab6cc

Please sign in to comment.