javascript - NodeJS - EMFILE Exception - request piped to writeStream -


Getting timely images from another server in a server Nodjes-time and store them in a specific folder.

I am doing this with this command (a function that gets by the timer every 10 seconds):

  request (cameraRequestOptions) .pipe (fs .createWriteStream (". / Campics / cam" + Camera ID + "Picture" + latest camera featurenumber + ".jpg"));   

Changing the name of the target image file due to "the latest camera fixtures".

I'm having trouble with an amiffeil exception, the strange thing is that this is happening only on some issues the server is running and it seems that it only happens after a long time.

As I have already found, it means doing something wrong so many Failstrym or socket opening IM that it could be that I'm not sure that my pipe: I written Strit or Close the request? And when how?

Documentation says:

Readable Pip (destination, [options]) #

Destination data to write destination writeable stream

Option Object Pipe Option

End Boolean Author Ends When Reader Ends

" Post-text "itemprop =" text ">

The problem seems to be more complicated, I add to the callback function to determine if all the streams and requests are closed properly Programming are, so it seems that the problem is caused by some other pipes I. The following stream using Oration:

  var fsCTmp = fs.createWriteStream ( ". / Campics /" + newLogId + "camera" + Kamraaidi + "picture" + picNum + ".jpg" ); FsCTmp.on ('end', wscfTest); Fs.createReadstream ("./Campix / Camera" + Camera ID + "Photo" + picNum + ".jpg"). Pipe (fsCTmp) .on ('finish', rsfTest);   
  var fsCP = fs.createWriteStream ( ". ./ camp / camera" + Kamraaidi + "photo" latest Kamraficr number + ".jpg"); FSCP.On ('Finnish', WSFTest); Request (Camerrequest Option) .pip (FSCP) .on ('Finnish', Rftext);   
  var fsWTmp = fs.createWriteStream ( ". ./ camp / + Skriyalarmficshatojhadtoog [J] .logId +" Cam "+ Kamraaidi +" picture "+ Skriyalarmficshaonaoadtiolog [j]. PicNum + ".jpg"); FsWTmp.on ( 'end', wscfTest); Fs.createReadStream (picturePath) .pipe (fsWTmp) .on ( 'end', Arsftest);   

and im sending a webclient via

  res.sendfile (& lt; path & gt;);   

I'm logging in to every callback functions in the console, everything works fine, but by now I'm doing this Only then could test itself on the PC, and the exception has been made only after a few pipes (about 10-100), except for each maskin.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -