3

NodeJS & Linux ENOENTED me. I know that the file is there, I can see it there.

Application is deployed on server by Jenkins CI server. NodeJS versions: v4.3.1 - prod, v4.3.2 - dev. It uses ExpressJS framework.

I use a single config-like file multiple times (old app logic) and I wanted to optimize that process. Since I use cluster I thougth "Hey, let's optimize that process and watch changes over that file, instead of loading it too many times (it weights 7.4KB).

So oustide express app I used setInterval (might not be a great idea) to check if configuration changed since last hour.

On dev server everything went smooth. On production, well (avg. load ~ 20 req/sec ) not even close.

I load on startup two files synchronously, but that 7.4KB file claims he's not there (ENOENT) even though it was deployed together with other configuration file that confirm's he's present.

At first I thought it had something to do with symlinks. But that seems not to be an issue. Is that the case of Publish Over SSH plugin ?

I'd like to know if there is a better way to to that (watch file changes in time invervals) and if there were any issues regarding readFile and symlink that might cause that strange behavior.

Looking forward to you answers. Thanks.

Update 19.06.2016

Link to plunkr with a sample answering machine app. That is just yet another use case example, but is similar to what I have implemented on that app.

https://plnkr.co/edit/LJUBiyFLcvXD0AbpC1G3?p=catalogue

0 Answers0