BinghamtonUniversity / IAMBing

A Highly Configurable Identity & Access Management (IAM) Engine
MIT License
3 stars 0 forks source link

Batch Delete Expired Entitlements #16

Closed timcortesi closed 2 years ago

timcortesi commented 2 years ago

@alikemaltanriverdi Can you please re-verify that this works? I refactored and simplified this code a couple weeks ago to remove redundancy.

Take a look at Kernel.php

        $schedule->call(function(){
            $identity_ids = IdentityEntitlement::where('type','add')->where('expiration_date',"<",Carbon::now())->get()->pluck('identity_id')->unique();    
            foreach($identity_ids as $identity_id){
                UpdateIdentityJob::dispatch([
                    'identity_id' => $identity_id
                ]);
            }
        })->name('delete_expired_identity_entitlements')->dailyAt(config('app.delete_expired_identity_entitlements'))->timezone('America/New_York')
        ->onOneServer();
timcortesi commented 2 years ago

Should be fixed by 4f246b8f3b9c35eb40fc56c8cf40fe4c2ee93728

@alikemaltanriverdi please verify

alikemaltanriverdi commented 2 years ago

This is working as expected