|
60 | 60 | use craft\events\RegisterUrlRulesEvent; |
61 | 61 | use craft\events\RegisterUserPermissionsEvent; |
62 | 62 | use craft\fields\Link; |
| 63 | +use craft\helpers\Console; |
63 | 64 | use craft\helpers\Cp; |
64 | 65 | use craft\queue\Queue; |
65 | 66 | use craft\services\Dashboard; |
@@ -442,13 +443,31 @@ private function _registerGarbageCollection(): void |
442 | 443 | { |
443 | 444 | Event::on(Gc::class, Gc::EVENT_RUN, function() { |
444 | 445 | // Delete incomplete submissions older than the configured interval. |
| 446 | + if (Craft::$app instanceof ConsoleApplication) { |
| 447 | + Console::stdout(' > purging incomplete Formie submissions ... '); |
| 448 | + } |
| 449 | + |
445 | 450 | $this->getSubmissions()->pruneIncompleteSubmissions(); |
446 | 451 |
|
| 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 | + |
447 | 457 | // Deletes submissions if they are past the form data retention settings. |
448 | 458 | $this->getSubmissions()->pruneDataRetentionSubmissions(); |
449 | 459 |
|
| 460 | + if (Craft::$app instanceof ConsoleApplication) { |
| 461 | + Console::stdout("done\n", Console::FG_GREEN); |
| 462 | + Console::stdout(' > purging Formie sent notifications ... '); |
| 463 | + } |
| 464 | + |
450 | 465 | // Delete sent notifications older than the configured interval. |
451 | 466 | $this->getSentNotifications()->pruneSentNotifications(); |
| 467 | + |
| 468 | + if (Craft::$app instanceof ConsoleApplication) { |
| 469 | + Console::stdout("done\n", Console::FG_GREEN); |
| 470 | + } |
452 | 471 | }); |
453 | 472 | } |
454 | 473 |
|
|
0 commit comments