src/util/sanity.js
// Hence we have to rewrite the script to fit this worker's needs.
Hence we have to rewrite the script to fit this worker's needs.
Hence we have to rewrite the script to fit this worker ' s needs .
function run(...args) {
    return new Promise((resolve, reject) => {
        const script = path.join(workerData.appPath, "..", "scripts/anime.py");
        const python = PythonShell.run(script, { mode: "json", args: args }, (error) => {
            if (error)
                reject(error);
        });
        python.on("message", (data) => {
            if (data.error)
                reject(data.error);
            resolve(data);
        });
        python.on("error", (error) => {
            reject(error);
        });
    });
}
function run ( ... args ) { return new Promise ( ( resolve , reject ) => { const script = path . join ( workerData . appPath , ".." , "scripts/anime.py" ) ; const python = PythonShell . run ( script , { mode : "json" , args : args } , ( error ) => { if ( error ) reject ( error ) ; } ) ; python . on ( "message" , ( data ) => { if ( data . error ) reject ( data . error ) ; resolve ( data ) ; } ) ; python . on ( "error" , ( error ) => { reject ( error ) ; } ) ; } ) ; }
Hence we have to rewrite the script to fit this worker's needs.
Hence we have to rewrite the script to fit this worker ' s needs .