L'application crashe en générant la db depuis la base complête
Lorsque l'on génère la base de données avec tout le contenu du repo "base", l'application crashe, se plaignant d'un nombre trop important de fichiers ouverts. Le bug persiste si on utilise graceful-fs.gracefulify(fs) dans src/_admin/generate_karasdb.js.
Voir le log suivant :
18:47:36 - info: Génération de la base - Dossier des .karas lu
/home/yoann/toyundamugen-app/node_modules/sqlite3/lib/trace.js:27
throw err;
^
Error: EMFILE: too many open files, open '/home/yoann/toyundamugen-app/app/data/karas/JAP - Suzumiya Haruhi no Yuutsu - OP1 - Asahina mikuru no bouken.kara'
at Error (native)
at Object.fs.openSync (fs.js:641:18)
at Object.fs.readFileSync (fs.js:509:33)
at addKara (/home/yoann/toyundamugen-app/src/_admin/generate_karasdb.js:855:45)
at /home/yoann/toyundamugen-app/src/_admin/generate_karasdb.js:115:37
at Array.forEach (native)
at Database.<anonymous> (/home/yoann/toyundamugen-app/src/_admin/generate_karasdb.js:114:43)
at Database.<anonymous> (/home/yoann/toyundamugen-app/src/_admin/generate_karasdb.js:98:47)
--> in Database#exec('CREATE VIEW IF NOT EXISTS all_karas AS SELECT k.PK_id_kara, k.kid, k.title, k.NORM_title, k.videolength, k.gain, k.year, k.videofile, k.subfile, k.date_added, k.date_last_modified, k.rating, k.viewcount\r\n,k.songorder\r\n,(select GROUP_CONCAT( s.name)\r\n FROM kara_series ks \r\n INNER JOIN series s ON ks.FK_id_series = s.PK_id_series\r\n WHERE k.PK_id_kara = ks.FK_id_kara\r\n ) as series\r\n,(select GROUP_CONCAT( s.NORM_name)\r\n FROM kara_series ks \r\n INNER JOIN series s ON ks.FK_id_series = s.PK_id_series\r\n WHERE k.PK_id_kara = ks.FK_id_kara\r\n ) as NORM_series\r\n,(select GROUP_CONCAT( s.altname)\r\n FROM kara_series ks \r\n INNER JOIN series s ON ks.FK_id_series = s.PK_id_series\r\n WHERE k.PK_id_kara = ks.FK_id_kara\r\n ) as series_altname\r\n,(select GROUP_CONCAT( s.NORM_altname)\r\n FROM kara_series ks \r\n INNER JOIN series s ON ks.FK_id_series = s.PK_id_series\r\n WHERE k.PK_id_kara = ks.FK_id_kara\r\n ) as NORM_series_altname\r\n,(select GROUP_CONCAT( t2.name)\r\n FROM kara_tag kt2 \r\n INNER JOIN tag t2 ON kt2.FK_id_tag = t2.PK_id_tag AND t2.tagtype = 2\r\n WHERE k.PK_id_kara = kt2.FK_id_kara\r\n ) as singer\r\n,(select GROUP_CONCAT( t2.NORM_name)\r\n FROM kara_tag kt2 \r\n INNER JOIN tag t2 ON kt2.FK_id_tag = t2.PK_id_tag AND t2.tagtype = 2\r\n WHERE k.PK_id_kara = kt2.FK_id_kara\r\n ) as NORM_singer\r\n,(select GROUP_CONCAT( t3.name)\r\n FROM kara_tag kt3 \r\n INNER JOIN tag t3 ON kt3.FK_id_tag = t3.PK_id_tag AND t3.tagtype = 3\r\n WHERE k.PK_id_kara = kt3.FK_id_kara\r\n ) as songtype\r\n,(select GROUP_CONCAT( t4.name)\r\n FROM kara_tag kt4 \r\n INNER JOIN tag t4 ON kt4.FK_id_tag = t4.PK_id_tag AND t4.tagtype = 4\r\n WHERE k.PK_id_kara = kt4.FK_id_kara\r\n ) as creator\r\n,(select GROUP_CONCAT( t4.NORM_name)\r\n FROM kara_tag kt4 \r\n INNER JOIN tag t4 ON kt4.FK_id_tag = t4.PK_id_tag AND t4.tagtype = 4\r\n WHERE k.PK_id_kara = kt4.FK_id_kara\r\n ) as NORM_creator\r\n,(select GROUP_CONCAT( t5.name)\r\n FROM kara_tag kt5 \r\n INNER JOIN tag t5 ON kt5.FK_id_tag = t5.PK_id_tag AND t5.tagtype = 5\r\n WHERE k.PK_id_kara = kt5.FK_id_kara\r\n ) as [language]\r\n,(select GROUP_CONCAT( t6.name)\r\n FROM kara_tag kt6 \r\n INNER JOIN tag t6 ON kt6.FK_id_tag = t6.PK_id_tag AND t6.tagtype = 6\r\n WHERE k.PK_id_kara = kt6.FK_id_kara\r\n ) as author\r\n,(select GROUP_CONCAT( t6.NORM_name)\r\n FROM kara_tag kt6 \r\n INNER JOIN tag t6 ON kt6.FK_id_tag = t6.PK_id_tag AND t6.tagtype = 6\r\n WHERE k.PK_id_kara = kt6.FK_id_kara\r\n ) as NORM_author\r\n,(select GROUP_CONCAT( t7.name)\r\n FROM kara_tag kt7 \r\n INNER JOIN tag t7 ON kt7.FK_id_tag = t7.PK_id_tag AND t7.tagtype = 7\r\n WHERE k.PK_id_kara = kt7.FK_id_kara\r\n ) as misc\r\n,(select GROUP_CONCAT( t8.name)\r\n FROM kara_tag kt8 \r\n INNER JOIN tag t8 ON kt8.FK_id_tag = t8.PK_id_tag AND t8.tagtype = 8\r\n WHERE k.PK_id_kara = kt8.FK_id_kara\r\n ) as songwriter\r\n,(select GROUP_CONCAT( t8.NORM_name)\r\n FROM kara_tag kt8 \r\n INNER JOIN tag t8 ON kt8.FK_id_tag = t8.PK_id_tag AND t8.tagtype = 8\r\n WHERE k.PK_id_kara = kt8.FK_id_kara\r\n ) as NORM_songwriter\r\nFROM kara k\r\norder by language, series, singer, songtype, songorder\r\n', [Function])
at Database.<anonymous> (/home/yoann/toyundamugen-app/src/_admin/generate_karasdb.js:89:39)
npm ERR! Linux 4.11.11-200.fc25.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! toyundamugen-app@2.0.0 start: `node src/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the toyundamugen-app@2.0.0 start script 'node src/index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the toyundamugen-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node src/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs toyundamugen-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls toyundamugen-app
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/yoann/toyundamugen-app/npm-debug.log