parent
66e873942d
commit
ba8aba4d17
1 changed files with 3 additions and 0 deletions
|
@ -48,6 +48,9 @@ impl Database {
|
||||||
|
|
||||||
/// Returns all users by ID. There are no access checks here, so this should only be used internally.
|
/// Returns all users by ID. There are no access checks here, so this should only be used internally.
|
||||||
pub async fn get_users_by_ids(&self, ids: Vec<UserId>) -> Result<Vec<user::Model>> {
|
pub async fn get_users_by_ids(&self, ids: Vec<UserId>) -> Result<Vec<user::Model>> {
|
||||||
|
if ids.len() >= 10000_usize {
|
||||||
|
return Err(anyhow!("too many users"))?;
|
||||||
|
}
|
||||||
self.transaction(|tx| async {
|
self.transaction(|tx| async {
|
||||||
let tx = tx;
|
let tx = tx;
|
||||||
Ok(user::Entity::find()
|
Ok(user::Entity::find()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue