diff options
Diffstat (limited to 'phpBB/includes/notification')
-rw-r--r-- | phpBB/includes/notification/manager.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/phpBB/includes/notification/manager.php b/phpBB/includes/notification/manager.php index 4e26234390..ee81cc0f7c 100644 --- a/phpBB/includes/notification/manager.php +++ b/phpBB/includes/notification/manager.php @@ -430,6 +430,13 @@ class phpbb_notification_manager // Store the creation array in our new rows that will be inserted later $new_rows[] = $notification->create_insert_array($data, $pre_create_data); + // Flush to DB if $new_rows is big enough. + if (sizeof($new_rows) > 500) + { + $this->db->sql_multi_insert($this->notifications_table, $new_rows); + $new_rows = array(); + } + // Users are needed to send notifications $user_ids = array_merge($user_ids, $notification->users_to_query()); @@ -448,8 +455,10 @@ class phpbb_notification_manager } } - // insert into the db - $this->db->sql_multi_insert($this->notifications_table, $new_rows); + if (!empty($new_rows)) + { + $this->db->sql_multi_insert($this->notifications_table, $new_rows); + } // We need to load all of the users to send notifications $this->user_loader->load_users($user_ids); |