mirror of
https://github.com/koush/scrypted.git
synced 2026-09-20 02:30:39 +01:00
common: fix zygote opts
This commit is contained in:
@@ -5,14 +5,16 @@ import os from 'os';
|
||||
|
||||
export type Zygote<T> = () => PluginFork<T>;
|
||||
|
||||
export function createZygote<T>(name: string): Zygote<T> {
|
||||
let zygote = sdk.fork<T>();
|
||||
export function createZygote<T>(name?: string, filename?: string): Zygote<T> {
|
||||
const opts = {
|
||||
name,
|
||||
filename,
|
||||
};
|
||||
let zygote = sdk.fork<T>(opts);
|
||||
function* next() {
|
||||
while (true) {
|
||||
const cur = zygote;
|
||||
zygote = sdk.fork<T>({
|
||||
name,
|
||||
});
|
||||
zygote = sdk.fork<T>(opts);
|
||||
yield cur;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user