denon icon indicating copy to clipboard operation
denon copied to clipboard

Trigger failsafe if many reloads are triggered

Open Tsourdox opened this issue 5 years ago • 2 comments

Not sure if this is the correct way to do it, but I wanted to save a cache script I could easily run.

"cache": {
      "desc": "Cache versions and update lock file",
      "cmd": "deno cache server.ts --lock-write",
      "lock": "./lock.json"
}

The result however when running denon cache is an endless loop instead of just executing it once, looks like this:

Skärmavbild 2020-05-29 kl  19 10 40

Now is this a bug or aren't you suppose to add and execute scripts in this way?

Tsourdox avatar May 29 '20 17:05 Tsourdox

You need to ignore ./lock.json, otherwise it will detect the changes made to it and restart in an infinite loop.

"watcher": {
    "skip": ["./lock.json"]
}

When stuck in an infinite loop you most likely aren't skipping the right files or directory.

eliassjogreen avatar May 29 '20 17:05 eliassjogreen

Probably we should add a failsafe for infinite loops if they happen within a short (and configurable) timespan. Marking this as a feature.

notfilippo avatar May 29 '20 17:05 notfilippo