Skip to content

Commit 2c25145

Browse files
committed
Fix memory limits for garbage collection tasks
1 parent 90b6bd9 commit 2c25145

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/services/SentNotifications.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ public function getDeliveryInfo($email): array
145145

146146
public function pruneSentNotifications(): void
147147
{
148+
App::maxPowerCaptain();
149+
148150
/* @var Settings $settings */
149151
$settings = Formie::$plugin->getSettings();
150152

src/services/Submissions.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
use craft\events\DefineUserContentSummaryEvent;
4444
use craft\events\IndexKeywordsEvent;
4545
use craft\events\SearchEvent;
46+
use craft\helpers\App;
4647
use craft\helpers\Console;
4748
use craft\helpers\Db;
4849
use craft\helpers\Json;
@@ -332,6 +333,8 @@ public function processPayments(Submission $submission): bool
332333

333334
public function pruneIncompleteSubmissions($consoleInstance = null): void
334335
{
336+
App::maxPowerCaptain();
337+
335338
/* @var Settings $settings */
336339
$settings = Formie::$plugin->getSettings();
337340

@@ -394,6 +397,8 @@ public function pruneIncompleteSubmissions($consoleInstance = null): void
394397

395398
public function pruneDataRetentionSubmissions($consoleInstance = null): void
396399
{
400+
App::maxPowerCaptain();
401+
397402
// Find all the forms with data retention settings
398403
$forms = (new Query())
399404
->select(['id', 'handle', 'dataRetention', 'dataRetentionValue'])
@@ -481,6 +486,8 @@ public function pruneDataRetentionSubmissions($consoleInstance = null): void
481486

482487
public function defineUserSubmissions(DefineUserContentSummaryEvent $event): void
483488
{
489+
App::maxPowerCaptain();
490+
484491
$userIds = Craft::$app->getRequest()->getRequiredBodyParam('userId');
485492

486493
$submissionCount = Submission::find()
@@ -497,6 +504,8 @@ public function defineUserSubmissions(DefineUserContentSummaryEvent $event): voi
497504

498505
public function deleteUserSubmissions(Event $event): void
499506
{
507+
App::maxPowerCaptain();
508+
500509
/** @var User $user */
501510
$user = $event->sender;
502511

@@ -531,6 +540,8 @@ public function deleteUserSubmissions(Event $event): void
531540

532541
public function restoreUserSubmissions(Event $event): void
533542
{
543+
App::maxPowerCaptain();
544+
534545
/** @var User $user */
535546
$user = $event->sender;
536547

0 commit comments

Comments
 (0)