mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
update user clear cache outside transaction
This commit is contained in:
@@ -405,11 +405,12 @@ class UserRepository extends BaseRepository
|
|||||||
$message['subject'] = nexus_trans('message.download_enable.subject', [], $targetUser->locale);
|
$message['subject'] = nexus_trans('message.download_enable.subject', [], $targetUser->locale);
|
||||||
$message['msg'] = nexus_trans('message.download_enable.body', ['operator' => $operatorUsername], $targetUser->locale);
|
$message['msg'] = nexus_trans('message.download_enable.body', ['operator' => $operatorUsername], $targetUser->locale);
|
||||||
}
|
}
|
||||||
return NexusDB::transaction(function () use ($targetUser, $update, $modComment, $message) {
|
$result = NexusDB::transaction(function () use ($targetUser, $update, $modComment, $message) {
|
||||||
Message::add($message);
|
Message::add($message);
|
||||||
$this->clearCache($targetUser);
|
|
||||||
return $targetUser->updateWithModComment($update, $modComment);
|
return $targetUser->updateWithModComment($update, $modComment);
|
||||||
});
|
});
|
||||||
|
$this->clearCache($targetUser);
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -506,8 +507,8 @@ class UserRepository extends BaseRepository
|
|||||||
$targetUser->usernameChangeLogs()->create($changeLog);
|
$targetUser->usernameChangeLogs()->create($changeLog);
|
||||||
$targetUser->username = $changeLog['username_new'];
|
$targetUser->username = $changeLog['username_new'];
|
||||||
$targetUser->save();
|
$targetUser->save();
|
||||||
$this->clearCache($targetUser);
|
|
||||||
});
|
});
|
||||||
|
$this->clearCache($targetUser);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -566,8 +567,8 @@ class UserRepository extends BaseRepository
|
|||||||
} else {
|
} else {
|
||||||
$targetUser->update($userUpdates);
|
$targetUser->update($userUpdates);
|
||||||
}
|
}
|
||||||
$this->clearCache($targetUser);
|
|
||||||
});
|
});
|
||||||
|
$this->clearCache($targetUser);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user