Skip to content

Commit 09df9d8

Browse files
Check if case retention policy is enabled before running job
1 parent 23c5f1a commit 09df9d8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

ProcessMaker/Console/Commands/EvaluateCaseRetention.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ class EvaluateCaseRetention extends Command
2727
*/
2828
public function handle()
2929
{
30+
// Only run if case retention policy is enabled
31+
$enabled = getenv('CASE_RETENTION_POLICY_ENABLED');
32+
if (!$enabled) {
33+
$this->info('Case retention policy is disabled');
34+
$this->error('Skipping case retention evaluation');
35+
36+
return;
37+
}
38+
39+
$this->info('Case retention policy is enabled');
3040
$this->info('Evaluating and deleting cases past their retention period');
3141

3242
// Process all processes when retention policy is enabled

0 commit comments

Comments
 (0)