@@ -195,8 +195,12 @@ function startFetchProcess(restartTime) {
195195 logger . error ( 'fetch process exit to much' ) ;
196196 process . exit ( 1 ) ;
197197 }
198- const chid = fork ( `utils/fetch.js` ) ;
199- chid . on ( 'message' , function ( message ) {
198+ let child = process . env . NODE_PRODUTION
199+ ? fork ( `utils/fetch.js` )
200+ : fork ( `utils/fetch.js` , [ ] , {
201+ execArgv : [ '--inspect-brk=46209' ]
202+ } ) ;
203+ child . on ( 'message' , function ( message ) {
200204 if ( typeof message === 'string' ) logger . info ( message ) ;
201205 else if ( message . success ) {
202206 const feed = message . eachFeed ;
@@ -209,15 +213,27 @@ function startFetchProcess(restartTime) {
209213 bot ,
210214 `${ feed . feed_title } : <a href="${ feed . url } ">${
211215 feed . url
212- } </a> ${ i18n [ 'ERROR_MANY_TIME' ] } ${ err }
213- ` ,
216+ } </a> ${ i18n [ 'ERROR_MANY_TIME' ] } ${ err } `,
214217 feed
215218 ) ;
216219 }
220+ if ( message . message === 'CHANGE' ) {
221+ const { feed, new_feed } = message ;
222+ const builder = [ ] ;
223+ builder . push (
224+ `${ feed . feed_title } : <a href="${ feed . url } "></a> ${
225+ i18n [ 'ERROR_MANY_TIME' ]
226+ } `
227+ ) ;
228+ builder . push ( `<b>${ i18n [ 'FOUND_FEEDS' ] } </b>:` ) ;
229+ builder . push ( ...new_feed ) ;
230+ builder . push ( `${ i18n [ 'FEED_CHANGE_TO' ] } ${ new_feed [ 0 ] } ` ) ;
231+ send ( bot , builder . join ( '\n' ) , feed ) ;
232+ }
217233 }
218234 } ) ;
219235
220- chid . on ( 'exit' , function ( code , signal ) {
236+ child . on ( 'exit' , function ( code , signal ) {
221237 logger . error ( `child process exit` ) ;
222238 logger . error ( {
223239 code,
0 commit comments