Commit 4e9cd261 authored by Jens Giessmann's avatar Jens Giessmann

patch feature/cli-dbsys-wait-timeout into release/5.7.x #3

parent bb3545f1
Pipeline #74039 passed with stage
in 4 minutes and 58 seconds
......@@ -83,6 +83,20 @@ return [
],
],
],
'dbSystem' => [
'on ' . yii\db\Connection::EVENT_AFTER_OPEN => function ($event) {
if ($event->sender->driverName === 'mysql') {
// set session wait_timeout for this connection to mysql default value to prevent connection-timeouts
// in e.g. audit module while exec long-running CLI processes
$event->sender->createCommand(
'SET SESSION wait_timeout = :timeout;',
[
':timeout' => (int)getenv('DB_ENV_MYSQL_CLI_WAIT_TIMEOUT') ?: 28800
]
)->execute();
}
},
],
],
'modules' => [
'user' => [
......
......@@ -115,6 +115,8 @@ DATABASE_USER=${DB_ENV_MYSQL_USER}
DATABASE_PASSWORD=${DB_ENV_MYSQL_PASSWORD}
DATABASE_TABLE_PREFIX=app_
# set session wait_timeout for dbSystem mysql connection to prevent connection-timeouts
DB_ENV_MYSQL_CLI_WAIT_TIMEOUT=28800
# Cache
# -----
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment