summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-08-12 18:18:47 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-08-12 18:18:47 +1000
commitfd829fc6692bba9c42c18cad0163819d1109a2e8 (patch)
treeff7b94f4fe93e4ec7b89b2ab9bb31c4f9de7569f /src/util
parentupdate jsonwebtoken and bcrypt (diff)
downloadserver-fd829fc6692bba9c42c18cad0163819d1109a2e8.tar.xz
Fix OOM on large guild join
Diffstat (limited to 'src/util')
-rw-r--r--src/util/entities/Member.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/util/entities/Member.ts b/src/util/entities/Member.ts
index 8be6eae1..d305e4f5 100644
--- a/src/util/entities/Member.ts
+++ b/src/util/entities/Member.ts
@@ -16,8 +16,7 @@
 	along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
-import { PublicUser, User } from "./User";
-import { Message } from "./Message";
+import { HTTPError } from "lambert-server";
 import {
 	BeforeInsert,
 	BeforeUpdate,
@@ -32,8 +31,8 @@ import {
 	PrimaryGeneratedColumn,
 	RelationId,
 } from "typeorm";
-import { Guild } from "./Guild";
-import { Config, emitEvent } from "../util";
+import { Ban, PublicGuildRelations } from ".";
+import { ReadyGuildDTO } from "../dtos";
 import {
 	GuildCreateEvent,
 	GuildDeleteEvent,
@@ -42,12 +41,13 @@ import {
 	GuildMemberUpdateEvent,
 	MessageCreateEvent,
 } from "../interfaces";
-import { HTTPError } from "lambert-server";
-import { Role } from "./Role";
-import { BaseClassWithoutId } from "./BaseClass";
-import { Ban, PublicGuildRelations } from ".";
+import { Config, emitEvent } from "../util";
 import { DiscordApiErrors } from "../util/Constants";
-import { ReadyGuildDTO } from "../dtos";
+import { BaseClassWithoutId } from "./BaseClass";
+import { Guild } from "./Guild";
+import { Message } from "./Message";
+import { Role } from "./Role";
+import { PublicUser, User } from "./User";
 
 export const MemberPrivateProjection: (keyof Member)[] = [
 	"id",
@@ -326,7 +326,7 @@ export class Member extends BaseClassWithoutId {
 			where: {
 				id: guild_id,
 			},
-			relations: [...PublicGuildRelations, "system_channel"],
+			relations: PublicGuildRelations,
 		});
 
 		const memberCount = await Member.count({ where: { guild_id } });