How it was

This commit is contained in:
Manav Rathi 2024-04-21 09:41:22 +05:30
parent 1026974e23
commit e39194d993
No known key found for this signature in database

View file

@ -201,13 +201,11 @@ const ffmpegExec = async (
/** Lazily create a singleton instance of our worker */
class WorkerFactory {
private _comlinkWorker: ComlinkWorker<typeof DedicatedFFmpegWorker>;
private _instance: Promise<Remote<DedicatedFFmpegWorker>>;
async instance() {
if (!this._instance) {
const comlinkWorker = createComlinkWorker();
this._comlinkWorker = comlinkWorker;
this._instance = comlinkWorker.remote;
}
return this._instance;