fix cron issues for UI and applications
This commit is contained in:
@@ -34,9 +34,13 @@ class Executions extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->task->application) {
|
if ($this->task->application) {
|
||||||
return $this->task->application->server;
|
if ($this->task->application->destination && $this->task->application->destination->server) {
|
||||||
|
return $this->task->application->destination->server;
|
||||||
|
}
|
||||||
} elseif ($this->task->service) {
|
} elseif ($this->task->service) {
|
||||||
return $this->task->service->server;
|
if ($this->task->service->destination && $this->task->service->destination->server) {
|
||||||
|
return $this->task->service->destination->server;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||||
|
use App\Models\Service;
|
||||||
|
use App\Models\Application;
|
||||||
|
|
||||||
class ScheduledTask extends BaseModel
|
class ScheduledTask extends BaseModel
|
||||||
{
|
{
|
||||||
@@ -31,27 +33,22 @@ class ScheduledTask extends BaseModel
|
|||||||
|
|
||||||
public function server()
|
public function server()
|
||||||
{
|
{
|
||||||
ray('Entering server() method in ScheduledTask model');
|
|
||||||
|
|
||||||
if ($this->application) {
|
if ($this->application) {
|
||||||
ray('Returning server from application');
|
if ($this->application->destination && $this->application->destination->server) {
|
||||||
$server = $this->application->server;
|
$server = $this->application->destination->server;
|
||||||
ray('Returning server from application: '.$server);
|
|
||||||
return $server;
|
return $server;
|
||||||
}
|
}
|
||||||
elseif ($this->database) {
|
|
||||||
ray('Returning server from database');
|
|
||||||
$server = $this->database->server;
|
|
||||||
ray('Returning server from database: '.$server);
|
|
||||||
return $server;
|
|
||||||
} elseif ($this->service) {
|
} elseif ($this->service) {
|
||||||
ray('Returning server from service');
|
if ($this->service->destination && $this->service->destination->server) {
|
||||||
$server = $this->service->server;
|
$server = $this->service->destination->server;
|
||||||
ray('Returning server from service: '.$server);
|
|
||||||
return $server;
|
return $server;
|
||||||
}
|
}
|
||||||
|
} elseif ($this->database) {
|
||||||
ray('No server found, returning null');
|
if ($this->database->destination && $this->database->destination->server) {
|
||||||
|
$server = $this->database->destination->server;
|
||||||
|
return $server;
|
||||||
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user