Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
phd5-app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dmstr
phd5-app
Commits
f2e108d6
Commit
f2e108d6
authored
Apr 06, 2023
by
Tobias Munk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use table prefix for redis workaround
parent
35025df2
Pipeline
#76544
passed with stage
in 7 minutes and 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
common.php
config/common.php
+2
-3
No files found.
config/common.php
View file @
f2e108d6
...
...
@@ -101,15 +101,14 @@ if (getenv('MYSQL_ATTR_SSL_CA')) {
}
// update Redis increment counter according to queue_manager db (workaround)
// TODO: use table_prefix
Event
::
on
(
Queue
::
class
,
Queue
::
EVENT_BEFORE_PUSH
,
function
(
$event
)
{
if
(
Yii
::
$app
->
cache
->
get
(
'queue_id_synced'
)
!==
true
)
{
$lastQueueIdSql
=
<<<SQL
SELECT `AUTO_INCREMENT`
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = '
app_
queue_manager'
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = '
{table_prefix}
queue_manager'
SQL;
$lastModelId
=
Yii
::
$app
->
db
->
createCommand
(
$lastQueueIdSql
)
->
queryScalar
();
$lastModelId
=
Yii
::
$app
->
db
->
createCommand
(
$lastQueueIdSql
,
[
'{table_prefix}'
=>
getenv
(
'DATABASE_TABLE_PREFIX'
)]
)
->
queryScalar
();
Yii
::
$app
->
redis
->
set
(
"queue.message_id"
,
$lastModelId
);
Yii
::
$app
->
cache
->
set
(
'queue_id_synced'
,
true
);
Yii
::
info
(
"Synced redis queue id with database (
$lastModelId
)"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment