Make RadiusServer singleton
This commit is contained in:
parent
9c7380a94f
commit
05278bda0c
@ -6,8 +6,21 @@ import { RadiusService } from './RadiusService';
|
|||||||
const packageInterface = PackageInterface.get();
|
const packageInterface = PackageInterface.get();
|
||||||
|
|
||||||
export class RadiusServer {
|
export class RadiusServer {
|
||||||
|
private static instance?: RadiusServer;
|
||||||
|
|
||||||
|
public static get(): RadiusServer {
|
||||||
|
if (!this.instance) {
|
||||||
|
this.instance = new this();
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.instance;
|
||||||
|
}
|
||||||
|
|
||||||
private server?: UDPServer;
|
private server?: UDPServer;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
|
private constructor() {}
|
||||||
|
|
||||||
public async up(): Promise<void> {
|
public async up(): Promise<void> {
|
||||||
const config = packageInterface.getConfig();
|
const config = packageInterface.getConfig();
|
||||||
const AuthMechanismus = (await import(`../auth/${config.authentication}`))[
|
const AuthMechanismus = (await import(`../auth/${config.authentication}`))[
|
||||||
|
Loading…
Reference in New Issue
Block a user