mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-15 06:02:28 +00:00
Fix memory leak in GameServer (#731)
* Convert entities to serializable after aggregating rather before * Cache instances of CustomXmlSerializer and create readonly constants for reused settings * Change CustomXmlSerializer and serializer cache to work with deserializer
This commit is contained in:
parent
0253864f5e
commit
2210541894
16 changed files with 125 additions and 147 deletions
|
@ -77,15 +77,14 @@ public class CommentController : ControllerBase
|
|||
where blockedProfile.UserId == token.UserId
|
||||
select blockedProfile.BlockedUserId).ToListAsync();
|
||||
|
||||
List<GameComment> comments = await this.database.Comments.Where(p => p.TargetId == targetId && p.Type == type)
|
||||
List<GameComment> comments = (await this.database.Comments.Where(p => p.TargetId == targetId && p.Type == type)
|
||||
.OrderByDescending(p => p.Timestamp)
|
||||
.Where(p => !blockedUsers.Contains(p.PosterUserId))
|
||||
.Include(c => c.Poster)
|
||||
.Where(p => p.Poster.PermissionLevel != PermissionLevel.Banned)
|
||||
.Skip(Math.Max(0, pageStart - 1))
|
||||
.Take(Math.Min(pageSize, 30))
|
||||
.Select(c => GameComment.CreateFromEntity(c, token.UserId))
|
||||
.ToListAsync();
|
||||
.ToListAsync()).ToSerializableList(c => GameComment.CreateFromEntity(c, token.UserId));
|
||||
|
||||
return this.Ok(new CommentListResponse(comments));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue