Skip to content

Commit

Permalink
chore: start worker directly using node instead of npm exec
Browse files Browse the repository at this point in the history
  • Loading branch information
midigofrank authored and stuartc committed Nov 15, 2023
1 parent 94f5281 commit eb6c81c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ config :lightning, Lightning.Vault,

config :lightning, Lightning.Runtime.RuntimeManager,
start: true,
args: ~w(npm exec @openfn/ws-worker -- --backoff 0.5/5),
args: ~w(node ./node_modules/.bin/worker -- --backoff 0.5/5),
cd: Path.expand("../assets", __DIR__)

# ## SSL Support
Expand Down
4 changes: 3 additions & 1 deletion lib/lightning/runtime/runtime_manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ defmodule Lightning.Runtime.RuntimeManager do
# to manage your NodeJs worker app, which is configured to run on port
# 2222. Since it's not always possible to kill that app, we'll ensure it's
# dead here in startup.
System.shell("kill $(lsof -n -i :2222 | grep LISTEN | awk '{print $2}')")
# EDIT: This is no longer needed when using: `node ./node_modules/.bin/worker`
# Source: https://stackoverflow.com/questions/75594758/sigterm-not-intercepted-by-the-handler-in-nodejs-app
# System.shell("kill $(lsof -n -i :2222 | grep LISTEN | awk '{print $2}')")

config = config()
{args, start_opts} = Keyword.pop(config, :args, [])
Expand Down

0 comments on commit eb6c81c

Please sign in to comment.