Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ISPConfig 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Helmo
ISPConfig 3
Commits
132081c0
Commit
132081c0
authored
10 years ago
by
Marius Cramer
Browse files
Options
Downloads
Patches
Plain Diff
- added check for mysql error to avoid flood of error messages/mails
parent
6d6643de
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
server/cron_daily.php
+2
-0
2 additions, 0 deletions
server/cron_daily.php
server/lib/app.inc.php
+18
-0
18 additions, 0 deletions
server/lib/app.inc.php
server/lib/classes/db_mysql.inc.php
+13
-0
13 additions, 0 deletions
server/lib/classes/db_mysql.inc.php
server/server.php
+2
-0
2 additions, 0 deletions
server/server.php
with
35 additions
and
0 deletions
server/cron_daily.php
+
2
−
0
View file @
132081c0
...
...
@@ -32,6 +32,8 @@ define('SCRIPT_PATH', dirname($_SERVER["SCRIPT_FILENAME"]));
require
SCRIPT_PATH
.
"/lib/config.inc.php"
;
require
SCRIPT_PATH
.
"/lib/app.inc.php"
;
$app
->
setCaller
(
'cron_daily'
);
set_time_limit
(
0
);
ini_set
(
'error_reporting'
,
E_ALL
&
~
E_NOTICE
);
...
...
This diff is collapsed.
Click to expand it.
server/lib/app.inc.php
+
18
−
0
View file @
132081c0
...
...
@@ -35,6 +35,7 @@ class app {
var
$loaded_modules
=
array
();
var
$loaded_plugins
=
array
();
var
$_calling_script
=
''
;
function
__construct
()
{
...
...
@@ -60,6 +61,23 @@ class app {
}
function
setCaller
(
$caller
)
{
$this
->
_calling_script
=
$caller
;
}
function
getCaller
()
{
return
$this
->
_calling_script
;
}
function
forceErrorExit
(
$errmsg
=
'undefined'
)
{
global
$conf
;
if
(
$this
->
_calling_script
==
'server'
)
{
@
unlink
(
$conf
[
'temppath'
]
.
$conf
[
'fs_div'
]
.
'.ispconfig_lock'
);
}
die
(
'Exiting because of error: '
.
$errmsg
);
}
function
uses
(
$classes
)
{
global
$conf
;
...
...
This diff is collapsed.
Click to expand it.
server/lib/classes/db_mysql.inc.php
+
13
−
0
View file @
132081c0
...
...
@@ -130,6 +130,8 @@ class db extends mysqli
}
public
function
query
(
$queryString
)
{
global
$app
;
if
(
$this
->
isConnected
==
false
)
return
false
;
$try
=
0
;
do
{
...
...
@@ -138,6 +140,17 @@ class db extends mysqli
if
(
!
$ok
)
{
if
(
!
$this
->
real_connect
(
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
$this
->
dbName
))
{
$this
->
updateError
(
'DB::query -> reconnect'
);
if
(
$this
->
errorNumber
==
'111'
)
{
// server is not available
if
(
$try
>
9
)
{
if
(
isset
(
$app
)
&&
isset
(
$app
->
forceErrorExit
))
{
$app
->
forceErrorExit
(
'Database connection failure!'
);
}
// if we reach this, the app object is missing or has no exit method, so we continue as normal
}
sleep
(
30
);
// additional seconds, please!
}
if
(
$try
>
9
)
{
return
false
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
server/server.php
+
2
−
0
View file @
132081c0
...
...
@@ -31,6 +31,8 @@ define('SCRIPT_PATH', dirname($_SERVER["SCRIPT_FILENAME"]));
require
SCRIPT_PATH
.
"/lib/config.inc.php"
;
require
SCRIPT_PATH
.
"/lib/app.inc.php"
;
$app
->
setCaller
(
'server'
);
set_time_limit
(
0
);
ini_set
(
'error_reporting'
,
E_ALL
&
~
E_NOTICE
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment