0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-12 16:10:43 -05:00

Fixed dep injection issue causing server to not start - http server isn't capable of injecting DatabaseService

Made `PostDbLoadProcess` error out if db validation fails
This commit is contained in:
Chomp 2024-11-23 15:38:58 +00:00
parent db88c00b4d
commit 320835f122
2 changed files with 2 additions and 11 deletions

View File

@ -10,7 +10,6 @@ import { WebSocketServer } from "@spt/servers/WebSocketServer";
import { IHttpListener } from "@spt/servers/http/IHttpListener";
import { LocalisationService } from "@spt/services/LocalisationService";
import { inject, injectAll, injectable } from "tsyringe";
import { DatabaseService } from "@spt/services/DatabaseService";
@injectable()
export class HttpServer {
@ -19,7 +18,6 @@ export class HttpServer {
constructor(
@inject("PrimaryLogger") protected logger: ILogger,
@inject("DatabaseService") protected databaseService: DatabaseService,
@inject("HttpServerHelper") protected httpServerHelper: HttpServerHelper,
@inject("LocalisationService") protected localisationService: LocalisationService,
@injectAll("HttpListener") protected httpListeners: IHttpListener[],
@ -36,12 +34,6 @@ export class HttpServer {
public load(): void {
this.started = false;
// If the database couldn't be validated, don't start the server
if (!this.databaseService.isDatabaseValid())
{
return;
}
/* create server */
const httpServer: Server = http.createServer();

View File

@ -61,9 +61,8 @@ export class PostDbLoadService {
// Kill the startup if not.
// TODO: We can probably remove this in a couple versions
this.databaseService.validateDatabase();
if (!this.databaseService.isDatabaseValid())
{
return;
if (!this.databaseService.isDatabaseValid()) {
throw new Error("Server start failure");
}
this.addCustomLooseLootPositions();