Skip to content

Commit

Permalink
Fix memory usage on integrity check
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Nov 15, 2023
1 parent 55d1fad commit 3d9b1ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static function onIntegrityCheck($event)
{
$integrityController = $event->sender;
$integrityController->showTestHeadline("Polls Module - Answers (" . PollAnswer::find()->count() . " entries)");
foreach (PollAnswer::find()->joinWith('poll')->all() as $answer) {
foreach (PollAnswer::find()->joinWith('poll')->each() as $answer) {
if ($answer->poll === null) {
if ($integrityController->showFix("Deleting poll answer id " . $answer->id . " without existing poll!")) {
$answer->delete();
Expand All @@ -81,7 +81,7 @@ public static function onIntegrityCheck($event)
}

$integrityController->showTestHeadline("Polls Module - Answers User (" . PollAnswerUser::find()->count() . " entries)");
foreach (PollAnswerUser::find()->joinWith(['poll', 'user'])->all() as $answerUser) {
foreach (PollAnswerUser::find()->joinWith(['poll', 'user'])->each() as $answerUser) {
if ($answerUser->poll === null) {
if ($integrityController->showFix("Deleting poll answer id " . $answerUser->id . " without existing poll!")) {
$answerUser->delete();
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

1.3.5 (Unreleased)
----------------------
- Fix #129: Fix memory usage on integrity check

1.3.4 (November, 10, 2023)
--------------------------
- Enh #127: Tests for `next` version
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Polls",
"description": "Empower your users to create polls and survey to drive engagement and gather valuable insights from your community.",
"keywords": ["poll", "voting", "decision making"],
"version": "1.3.4",
"version": "1.3.5",
"humhub": {
"minVersion": "1.14"
},
Expand Down

0 comments on commit 3d9b1ca

Please sign in to comment.