Apply suggestions from code review

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
Michael Vogel 2021-10-03 21:58:05 +02:00 committed by GitHub
parent 674249ccfc
commit 366fbbd3e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -439,8 +439,7 @@ function mailstream_html_wrap(&$text)
*/ */
function mailstream_convert_table_entries() function mailstream_convert_table_entries()
{ {
$ms_item_ids = DBA::selectToArray('mailstream_item', ['message-id', 'uri', 'uid', 'contact-id'], ["`mailstream_item`.`completed` IS NULL"]); $ms_item_ids = DBA::selectToArray('mailstream_item', [], ['message-id', 'uri', 'uid', 'contact-id'], ["`mailstream_item`.`completed` IS NULL"]);
if (DBA::isResult($ms_item_ids)) {
Logger::debug('mailstream_convert_table_entries processing ' . count($ms_item_ids) . ' items'); Logger::debug('mailstream_convert_table_entries processing ' . count($ms_item_ids) . ' items');
foreach ($ms_item_ids as $ms_item_id) { foreach ($ms_item_ids as $ms_item_id) {
$send_hook_data = array('uid' => $ms_item_id['uid'], $send_hook_data = array('uid' => $ms_item_id['uid'],
@ -456,7 +455,6 @@ function mailstream_convert_table_entries()
Logger::info('mailstream_convert_table_entries: convert item to workerqueue', $send_hook_data); Logger::info('mailstream_convert_table_entries: convert item to workerqueue', $send_hook_data);
Hook::fork(PRIORITY_LOW, 'mailstream_send_hook', $send_hook_data); Hook::fork(PRIORITY_LOW, 'mailstream_send_hook', $send_hook_data);
} }
}
DBA::e('DROP TABLE `mailstream_item`'); DBA::e('DROP TABLE `mailstream_item`');
} }