Unitech / Unitech/pm2

Watching changes in external folder

Open
#4,977 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

I'm trying to tell my application (frontend made on react) to rebuild if changes occure in backend (headless cms strapi), i figured out what exact strapi folder is modified each time I'm making any changes there, and trying to configure my pm2 script to watch it for changes.

This is how my json looks like

{
	"apps" : [{
	  "name":"frontend",
	  "cwd":"./shop",
	  "script":"npm",
	  "args":"start",
	  "watch":"../cms/.tmp/data.db",
	}],
}

But it ain't working out.

my folder structure looks like this:
root

| - pm2.json
| - shop
| - cms
       | - .tmp
               | - data.db

I tried to figure out how to make it via ecosystem, but also failed, had this error in error.log

(sharp:2783887): GLib-CRITICAL **: 21:48:43.712: g_hash_table_lookup: assertion 'hash_table != NULL' failed

my system information is next:
Strapi Version: 3.1.0-alpha.5
Operating System: Ubuntu 20.04
Node Version: 10.23.0
NPM Version: 6.14.8
PM2 Version: 4.5.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pm2.json configuration and the watch setting shown in the issue, then check PM2's ecosystem configuration behavior for paths outside the app cwd. Reproduce the setup with shop and cms/.tmp/data.db; done means the frontend process rebuilds when that external file changes without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.