Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Merge requests
!1500
Resolve "Fix Admin Interface"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Fix Admin Interface"
928-fix-admin-interface
into
development
Overview
0
Commits
4
Pipelines
3
Changes
9
Merged
Dominik Hebeler
requested to merge
928-fix-admin-interface
into
development
5 years ago
Overview
0
Commits
4
Pipelines
3
Changes
9
Expand
Closes
#928 (closed)
Edited
5 years ago
by
Dominik Hebeler
0
0
Merge request reports
Compare
development
version 1
fa964cf7
5 years ago
development (base)
and
latest version
latest version
efc4efb5
4 commits,
5 years ago
version 1
fa964cf7
2 commits,
5 years ago
9 files
+
157
−
34
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
9
Search (e.g. *.vue) (Ctrl+P)
app/Console/Commands/WaitDB.php
0 → 100644
+
55
−
0
Options
<?php
namespace
App\Console\Commands
;
use
DB
;
use
Illuminate\Console\Command
;
class
WaitDB
extends
Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'wait:db'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
'Waits until default DB connection is available. '
;
/**
* Create a new command instance.
*
* @return void
*/
public
function
__construct
()
{
parent
::
__construct
();
}
/**
* Execute the console command.
*
* @return mixed
*/
public
function
handle
()
{
$starttime
=
microtime
(
true
);
while
(
microtime
(
true
)
-
$starttime
<
60
)
{
try
{
$connection
=
DB
::
connection
(
'mysql'
)
->
getPdo
();
$this
->
line
(
"Connection to database successfull"
);
return
0
;
}
catch
(
\Exception
$e
)
{
$this
->
error
(
$e
->
getMessage
());
sleep
(
1
);
}
}
return
1
;
}
}
Loading