File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 11import { container } from 'tsyringe' ;
22import CliArgumentProvider from '../cli/CliArgumentProvider.js' ;
3+ import AppConfiguration from '../config/AppConfiguration.js' ;
34import ContinuousQueueWorker from '../import_queue/worker/ContinuousQueueWorker.js' ;
45import TaskScheduler from '../task_queue/TaskScheduler.js' ;
6+ import FastifyWebServer from '../webserver/FastifyWebServer.js' ;
57import App from './App.js' ;
68
79export default class QueueWorkerApp implements App {
810 private taskScheduler : TaskScheduler | undefined ;
11+ private webServer : FastifyWebServer | undefined ;
912
1013 async boot ( ) : Promise < void > {
1114 if ( CliArgumentProvider . determineLeftoverArgs ( ) . length !== 0 ) {
@@ -20,11 +23,21 @@ export default class QueueWorkerApp implements App {
2023 . resolve ( ContinuousQueueWorker )
2124 . start ( ) ;
2225
26+ // DEBUG
27+ const appConfig = container . resolve ( AppConfiguration ) ;
28+ this . webServer = container . resolve ( FastifyWebServer ) ;
29+
30+ await this . webServer . listen ( appConfig . config . serverInterface , appConfig . config . serverPort + 100 ) ;
31+ // DEBUG END
32+
2333 console . log ( '\nQueue worker finished initialization' ) ;
2434 }
2535
2636 async shutdown ( ) : Promise < void > {
2737 this . taskScheduler ?. dispose ( ) ;
2838 this . taskScheduler = undefined ;
39+
40+ await this . webServer ?. shutdown ( ) ;
41+ this . webServer = undefined ;
2942 }
3043}
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export type PotentialServerStatus = {
3535 favicon ?: string ;
3636}
3737
38+ // TODO: Handle proxy connection errors and introduce retry mechanism
3839export default abstract class AbstractMinecraftServerPing {
3940 private static readonly socksProxyConnector = new SocksProxyServerConnector ( ) ;
4041 private static socksProxyPool : RoundRobinProxyPool < SocksProxyServer > | undefined ;
You can’t perform that action at this time.
0 commit comments