Skip to content

Commit 90b6bd9

Browse files
committed
Fix lack of console output for garbage collection tasks
1 parent f77e665 commit 90b6bd9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Formie.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
use craft\events\RegisterUrlRulesEvent;
6161
use craft\events\RegisterUserPermissionsEvent;
6262
use craft\fields\Link;
63+
use craft\helpers\Console;
6364
use craft\helpers\Cp;
6465
use craft\queue\Queue;
6566
use craft\services\Dashboard;
@@ -442,13 +443,31 @@ private function _registerGarbageCollection(): void
442443
{
443444
Event::on(Gc::class, Gc::EVENT_RUN, function() {
444445
// Delete incomplete submissions older than the configured interval.
446+
if (Craft::$app instanceof ConsoleApplication) {
447+
Console::stdout(' > purging incomplete Formie submissions ... ');
448+
}
449+
445450
$this->getSubmissions()->pruneIncompleteSubmissions();
446451

452+
if (Craft::$app instanceof ConsoleApplication) {
453+
Console::stdout("done\n", Console::FG_GREEN);
454+
Console::stdout(' > purging Formie submissions based on data retention ... ');
455+
}
456+
447457
// Deletes submissions if they are past the form data retention settings.
448458
$this->getSubmissions()->pruneDataRetentionSubmissions();
449459

460+
if (Craft::$app instanceof ConsoleApplication) {
461+
Console::stdout("done\n", Console::FG_GREEN);
462+
Console::stdout(' > purging Formie sent notifications ... ');
463+
}
464+
450465
// Delete sent notifications older than the configured interval.
451466
$this->getSentNotifications()->pruneSentNotifications();
467+
468+
if (Craft::$app instanceof ConsoleApplication) {
469+
Console::stdout("done\n", Console::FG_GREEN);
470+
}
452471
});
453472
}
454473

0 commit comments

Comments
 (0)