Skip to content

Commit 2da9c6d

Browse files
committed
Remove redundant inline comments
1 parent 0f0f5e8 commit 2da9c6d

3 files changed

Lines changed: 2 additions & 11 deletions

File tree

packages/core/src/usecase/CreateServerForUser.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@ export class CreateServerForUser {
3636
const { serverManagerFactory, serverRepository, userCreditsRepository, eventLogger, sourceTvEventLogger, configManager, userRepository, guildParametersRepository, userBanRepository } = this.dependencies;
3737
const statusUpdater = args.statusUpdater;
3838

39-
// Get the appropriate server manager for this region
4039
const serverManager = serverManagerFactory.createServerManager(args.region);
4140
const user = await userRepository.getById(args.creatorId);
4241
if (!user || !user.steamIdText) {
4342
throw new UserError('Before creating a server, please set your Steam ID using the `/set-user-data` command. This is required to give you admin access to the server.');
4443
}
4544

46-
// Check if user is banned
4745
const steamId = new SteamID(user.steamIdText);
4846
const steamID3 = steamId.steam3().replace("[", "").replace("]", "");
4947

@@ -96,10 +94,6 @@ export class CreateServerForUser {
9694
}
9795
const serverId = uuid();
9896

99-
// Use a transaction to ensure atomicity and consistency
100-
// Also, if the server creation fails, we want the server ID To be in the database
101-
// so we can delete it later
102-
10397
await serverRepository.runInTransaction(async (trx) => {
10498
const allServers = await serverRepository.getAllServersByUserId(args.creatorId, trx);
10599
const runningServers = allServers.filter(server => server.status === "ready" || server.status === "pending");
@@ -146,4 +140,4 @@ export class CreateServerForUser {
146140
});
147141
return server;
148142
}
149-
}
143+
}

packages/core/src/usecase/DeleteServerForUser.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ export class DeleteServerForUser {
2222
const { serverRepository, serverActivityRepository, serverManagerFactory, eventLogger, serverAbortManager } = this.dependencies;
2323
const { userId } = args;
2424

25-
// Use transaction to ensure consistency
2625
await serverRepository.runInTransaction(async (trx) => {
2726
const server = await serverRepository.getAllServersByUserId(userId, trx);
2827

2928
if (!server || server.length === 0) {
3029
return;
3130
}
3231

33-
// Mark all servers as terminating
3432
for (const s of server) {
3533
await serverRepository.upsertServer({
3634
...s,

packages/core/src/usecase/TerminateServersWithoutCredit.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export class TerminateServersWithoutCredit {
4747

4848
// Terminate servers without credits
4949
const terminationPromises = await Promise.allSettled(serversWithoutCredits.map(async server => {
50-
// Get the appropriate server manager for this region
5150
const serverManager = serverManagerFactory.createServerManager(server.region);
5251
await serverCommander.query({
5352
command: `say Your server is being terminated due to lack of credits.`,
@@ -74,4 +73,4 @@ export class TerminateServersWithoutCredit {
7473
throw new Error(`Failed to terminate some servers: ${errors.join(', ')}`)
7574
}
7675
}
77-
}
76+
}

0 commit comments

Comments
 (0)