File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public function handle()
3030 $ this ->info ('Evaluating and deleting cases past their retention period ' );
3131
3232 // Process all processes when retention policy is enabled
33- // Processes without retention_period will default to 6 months
33+ // Processes without retention_period will default to 1_year
3434 Process::chunkById (100 , function ($ processes ) {
3535 foreach ($ processes as $ process ) {
3636 dispatch (new EvaluateProcessRetentionJob ($ process ->id ));
Original file line number Diff line number Diff line change @@ -27,9 +27,8 @@ public function __construct(public int $processId)
2727 public function handle (): void
2828 {
2929 // Only run if case retention policy is enabled
30- // Use getenv() to read directly from environment (works better in tests)
31- $ enabled = getenv ('CASE_RETENTION_POLICY_ENABLED ' );
32- if ($ enabled === false || $ enabled === 'false ' || $ enabled === '0 ' || $ enabled === '' ) {
30+ $ enabled = config ('app.case_retention_policy_enabled ' );
31+ if (!$ enabled ) {
3332 return ;
3433 }
3534
@@ -40,14 +39,14 @@ public function handle(): void
4039 return ;
4140 }
4241
43- // Default to 6 months if retention_period is not set
44- $ retentionPeriod = $ process ->properties ['retention_period ' ] ?? '6_months ' ;
42+ // Default to 1_year if retention_period is not set
43+ $ retentionPeriod = $ process ->properties ['retention_period ' ] ?? '1_year ' ;
4544 $ retentionMonths = match ($ retentionPeriod ) {
4645 '6_months ' => 6 ,
4746 '1_year ' => 12 ,
4847 '3_years ' => 36 ,
4948 '5_years ' => 60 ,
50- default => 6 , // Default to 6 months
49+ default => 12 , // Default to 1_year
5150 };
5251
5352 // Default retention_updated_at to now if not set
You can’t perform that action at this time.
0 commit comments