Skip to content

Commit

Permalink
refactor: Remove unused import and function in MainLoop.js
Browse files Browse the repository at this point in the history
  • Loading branch information
drazisil committed Jun 1, 2024
1 parent 5770642 commit 12ba3c2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
2 changes: 0 additions & 2 deletions packages/main/src/MainLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.

import { emitKeypressEvents } from "node:readline";
import { _atExit } from "obsidian-main";

export class MainLoop {
/** @type {NodeJS.Timeout | undefined} */
Expand Down Expand Up @@ -88,7 +87,6 @@ export class MainLoop {
process.stdin.setRawMode(false);
console.log("Exiting...");
await this._callTasks(this._stopTasks);
_atExit();
}
}

Expand Down
2 changes: 0 additions & 2 deletions packages/main/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ declare module "obsidian-main" {
export interface IShardEntry {
formatForWeb(): string;
}

export function _atExit(): void;
}
15 changes: 5 additions & 10 deletions packages/main/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ function onSocketListening(s) {
});
}

export async function _atExit(exitCode = 0) {
console.log("Goodbye, world!");
process.exit(exitCode);
}

// === MAIN ===

export default function main() {
Expand All @@ -133,13 +128,13 @@ export default function main() {
8226,
onSocketListening,
(socket) => onSocketConnection(socket, onNPSData),
onServerError,
onServerError
);
personaServer = new TCPServer(
8228,
onSocketListening,
(socket) => onSocketConnection(socket, onNPSData),
onServerError,
onServerError
);

const shardService = new ShardService();
Expand All @@ -148,7 +143,7 @@ export default function main() {
"Rusty Motors",
"A test shard",
"10.10.5.20",
"Group - 1",
"Group - 1"
);

const userLoginService = new UserLoginService();
Expand All @@ -161,11 +156,11 @@ export default function main() {
mainLoop.addTask("stop", loginServer.close.bind(loginServer, onServerError));
mainLoop.addTask(
"stop",
personaServer.close.bind(personaServer, onServerError),
personaServer.close.bind(personaServer, onServerError)
);
mainLoop.addTask(
"stop",
userLoginService.deleteAllTokens.bind(userLoginService),
userLoginService.deleteAllTokens.bind(userLoginService)
);

mainLoop.start();
Expand Down

0 comments on commit 12ba3c2

Please sign in to comment.