Skip to content

Commit faef18f

Browse files
committed
user update/delete/insert jobs
* incremented retry policy Change-Id: I66ac2dca9806a0029e7ba3ee46e708db05885806
1 parent 6aef9d9 commit faef18f

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

app/Jobs/PublishUserCreated.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ class PublishUserCreated implements ShouldQueue
2828
{
2929
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
3030

31+
/**
32+
* The number of times the job may be attempted.
33+
*
34+
* @var int
35+
*/
36+
public $tries = 5;
37+
3138
/**
3239
* @var int
3340
*/

app/Jobs/PublishUserDeleted.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ class PublishUserDeleted implements ShouldQueue
2727
{
2828
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
2929

30+
/**
31+
* The number of times the job may be attempted.
32+
*
33+
* @var int
34+
*/
35+
public $tries = 5;
36+
3037
/**
3138
* @var int
3239
*/

app/Jobs/PublishUserUpdated.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ class PublishUserUpdated implements ShouldQueue
2727
{
2828
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
2929

30+
/**
31+
* The number of times the job may be attempted.
32+
*
33+
* @var int
34+
*/
35+
public $tries = 5;
36+
3037
/**
3138
* @var int
3239
*/

app/Services/OpenId/UserService.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use App\libs\Auth\Repositories\IGroupRepository;
2121
use App\Services\AbstractService;
2222
use App\Services\Auth\IUserIdentifierGeneratorService;
23+
use Auth\Group;
2324
use Auth\IUserNameGeneratorService;
2425
use Auth\Repositories\IUserRepository;
2526
use Auth\User;
@@ -296,8 +297,9 @@ public function update(int $id, array $payload): IEntity
296297
$user->clearGroups();
297298
foreach ($payload['groups'] as $group_id) {
298299
$group = $this->group_repository->getById($group_id);
299-
if (is_null($group))
300+
if (!$group instanceof Group)
300301
throw new EntityNotFoundException("group not found");
302+
301303
$user->addToGroup($group);
302304
}
303305
}
@@ -312,6 +314,7 @@ public function update(int $id, array $payload): IEntity
312314
Log::warning(sprintf("UserService::update use id %s - password changed", $id));
313315
Event::dispatch(new UserPasswordResetSuccessful($user->getId()));
314316
}
317+
315318
return $user;
316319
});
317320

0 commit comments

Comments
 (0)