-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
55 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,8 +54,5 @@ public function handle(): void | |
|
||
} | ||
|
||
|
||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,13 +33,13 @@ public function boot() | |
// Mail::alwaysTo('[email protected]'); | ||
Model::preventLazyLoading(); | ||
} | ||
//TODO comment this for testing part | ||
/* RateLimiter::for('mda-run-limit', function (RunMdaScript $job) { | ||
$diskName = config('storageCfg.name'); | ||
$pathToDirectory = Storage::disk($diskName)->path($job->federation->name); | ||
$lockKey = 'directory-'.md5($pathToDirectory).'-lock'; | ||
return Limit::perMinute(1)->by($lockKey); | ||
});*/ | ||
//TODO comment this for testing part | ||
/* RateLimiter::for('mda-run-limit', function (RunMdaScript $job) { | ||
$diskName = config('storageCfg.name'); | ||
$pathToDirectory = Storage::disk($diskName)->path($job->federation->name); | ||
$lockKey = 'directory-'.md5($pathToDirectory).'-lock'; | ||
return Limit::perMinute(1)->by($lockKey); | ||
});*/ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Services; | ||
|
||
use App\Models\Entity; | ||
use App\Models\User; | ||
use Illuminate\Support\Facades\Notification; | ||
|
||
|
||
class NotificationService{ | ||
|
||
public static function sendEntityNotification(Entity $entity,$notification){ | ||
class NotificationService | ||
{ | ||
public static function sendEntityNotification(Entity $entity, $notification) | ||
{ | ||
$admins = User::activeAdmins()->select('id', 'email')->get(); | ||
|
||
$operators = $entity->operators->pluck('id')->toArray(); | ||
|
||
$filteredAdmins = $admins->filter(function ($admin) use ($operators) { | ||
return !in_array($admin->id, $operators); | ||
return ! in_array($admin->id, $operators); | ||
}); | ||
|
||
Notification::sendNow($entity->operators, new $notification($entity)); | ||
Notification::sendNow($filteredAdmins, new $notification($entity)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters