1
0
forked from noxious/server

Minor improvement

This commit is contained in:
Dennis Postma 2025-02-10 14:44:35 +01:00
parent a8a98d0083
commit 94c619192b

View File

@ -20,7 +20,6 @@ class WeatherManager {
} as const } as const
private readonly logger = Logger.type(LoggerType.APP) private readonly logger = Logger.type(LoggerType.APP)
private io: Server | null = null
private intervalId: NodeJS.Timeout | null = null private intervalId: NodeJS.Timeout | null = null
private weatherState: WeatherState = { private weatherState: WeatherState = {
@ -29,7 +28,6 @@ class WeatherManager {
} }
public async boot(): Promise<void> { public async boot(): Promise<void> {
this.io = SocketManager.getIO()
await this.loadWeather() await this.loadWeather()
this.startWeatherLoop() this.startWeatherLoop()
this.logger.info('Weather manager loaded') this.logger.info('Weather manager loaded')
@ -113,7 +111,8 @@ class WeatherManager {
} }
private emitWeather(): void { private emitWeather(): void {
this.io?.emit('weather', this.weatherState) const io = SocketManager.getIO()
io?.emit('weather', this.weatherState)
} }
private async saveWeather(): Promise<void> { private async saveWeather(): Promise<void> {