File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
app/code/Magento/MysqlMq/Model/ResourceModel Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -167,25 +167,14 @@ public function getMessages($queueName, $limit = null)
167
167
*
168
168
* @return void
169
169
*/
170
- public function deleteMarkedMessages ()
170
+ public function deleteMarkedMessages (): void
171
171
{
172
172
$ connection = $ this ->getConnection ();
173
173
174
174
$ select = $ connection ->select ()
175
175
->from (['queue_message_status ' => $ this ->getMessageStatusTable ()], ['message_id ' ])
176
- ->where ('status <> ? ' , QueueManagement::MESSAGE_STATUS_TO_BE_DELETED )
177
- ->distinct ();
178
- $ messageIds = $ connection ->fetchCol ($ select );
179
-
180
- if ($ messageIds ) {
181
- $ condition = count ($ messageIds ) > 0 ? ['id NOT IN (?) ' => $ messageIds ] : null ;
182
- $ connection ->delete ($ this ->getMessageTable (), $ condition );
183
- } else {
184
- $ select = $ connection ->select ()
185
- ->from (['queue_message_status ' => $ this ->getMessageStatusTable ()], ['message_id ' ])
186
- ->where ('status = ? ' , QueueManagement::MESSAGE_STATUS_TO_BE_DELETED );
187
- $ connection ->delete ($ this ->getMessageTable (), 'id IN ( ' . $ select ->assemble () . ') ' );
188
- }
176
+ ->where ('status = ? ' , QueueManagement::MESSAGE_STATUS_TO_BE_DELETED );
177
+ $ connection ->delete ($ this ->getMessageTable (), 'id IN ( ' . $ select ->assemble () . ') ' );
189
178
}
190
179
191
180
/**
You can’t perform that action at this time.
0 commit comments