2

I want pm2 to stop watching folders which have a name like cache or tmp.

I tried a lot of manners in my app.json config file :

{"apps": [{
    "name": "BSTAT",
    "script": "./server/app.js",
    "watch": true,
    "ignore_watch": [
        "HERE IS WHAT I HAVE TRIED ==>",
        "*cache*",
        "*/cache",
        "cache/",
        "*cache/*"
    ],
}]}

and also saw this question who doesn't seem to have an exemple of that case.

The only way that I find to resolve the problem was to put the exact path like server/my-module/cache

I can not bring myself to think this is not possible...that's why I request your help :)

TOPKAT
  • 6,667
  • 2
  • 44
  • 72

1 Answers1

4

you need a regex for this, e.g.:

ignore_watch : ['./**/*tests.js', ] 

this pattern will ignore all files with name "tests.js" in all project folders

webolizzer
  • 337
  • 2
  • 5