chore: Refactor DatabaseBackupJob to handle missing team
This commit is contained in:
parent
0da31c34b5
commit
d84d0a816b
1 changed files with 6 additions and 1 deletions
|
|
@ -66,7 +66,12 @@ public function __construct($backup)
|
|||
public function handle(): void
|
||||
{
|
||||
try {
|
||||
$this->team = Team::findOrFail($this->backup->team_id);
|
||||
$this->team = Team::find($this->backup->team_id);
|
||||
if (! $this->team) {
|
||||
$this->backup->delete();
|
||||
|
||||
return;
|
||||
}
|
||||
if (data_get($this->backup, 'database_type') === 'App\Models\ServiceDatabase') {
|
||||
$this->database = data_get($this->backup, 'database');
|
||||
$this->server = $this->database->service->server;
|
||||
|
|
|
|||
Loading…
Reference in a new issue