Bootstrap.storage.storePerformanceStatistics(msg.data);
}
});
- if (!Bootstrap.workerImplementation) {
- throw new Error('Worker implementation not found');
- }
}
private logPrefix(): string {
import { MongoDBStorage } from './MongoDBStorage';
import { Storage } from './Storage';
import { StorageType } from '../../types/Storage';
-import logger from '../Logger';
export class StorageFactory {
// eslint-disable-next-line @typescript-eslint/no-empty-function
storageInstance = new MongoDBStorage(connectionURI, logPrefix);
break;
default:
- logger.error(`${logPrefix} Unknown storage type: ${type}`);
+ throw new Error(`${logPrefix} Unknown storage type: ${type}`);
}
return storageInstance;
}
options.poolMaxSize = options.poolMaxSize ?? Constants.DEFAULT_WORKER_POOL_MAX_SIZE;
workerImplementation = new WorkerDynamicPool<T>(workerScript, options.poolMinSize, options.poolMaxSize, options.startDelay, options.poolOptions, messageListenerCallback);
break;
+ default:
+ throw new Error(`Worker implementation type '${workerProcessType}' not found`);
}
return workerImplementation;
}