Skip to content
This repository has been archived by the owner on Jan 7, 2018. It is now read-only.

Commit

Permalink
Fix router reloads/deploys not picking up latest code changes.
Browse files Browse the repository at this point in the history
Since we were relying on the PATH set in lib/process_env.js to pick up
the binary paths, this PATH was only being set at start-time and not on
reloads. Since the PATH being set contained a resolved path, it meant
that the "current" symlink used for deployments got resolved at start
time, so the processes would forever use that deployment folder (eg,
router/releases/20150126015553 instead of router/current). This
prevented reloads from ever actually picking up code changes to the
router project.

This fixes it by using the "current" path in our paths to the binaries,
so the symlink will be resolved each time. This mirrors how we handle
the current path for the web project (and why the reloads were working
for that project).
  • Loading branch information
GUI committed Jan 26, 2015
1 parent cc47247 commit 00d849d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ static_site:
router:
api_backends:
port: 14011
dir: /opt/api-umbrella/embedded/apps/router/current
trusted_proxies: []
global_rate_limits:
ip_rate: "100r/s"
Expand Down
10 changes: 5 additions & 5 deletions templates/etc/supervisord.conf.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ startsecs=5
{{#each gatekeeper_hosts}}
[program:{{process_name}}]
environment=NODE_LOG_DIR="{{../log_dir}}",NODE_ENV="{{../app_env}}"
command=api-umbrella-gatekeeper {{../api_umbrella_config_args}} -p {{port}}
command={{../router.dir}}/node_modules/.bin/api-umbrella-gatekeeper {{../api_umbrella_config_args}} -p {{port}}
{{../supervisor_conditional_user}}
redirect_stderr=true
stdout_logfile={{../log_dir}}/%(program_name)s.log
Expand All @@ -101,15 +101,15 @@ startsecs=5
programs={{gatekeeper_supervisor_process_names}}

[program:config-reloader]
command=api-umbrella-config-reloader {{api_umbrella_config_args}}
command={{router.dir}}/bin/api-umbrella-config-reloader {{api_umbrella_config_args}}
redirect_stderr=true
stdout_logfile={{log_dir}}/%(program_name)s.log
stderr_logfile=NONE
logfile_maxbytes=0
startsecs=10

[program:router-log-listener]
command=api-umbrella-router-log-listener {{api_umbrella_config_args}}
command={{router.dir}}/bin/api-umbrella-router-log-listener {{api_umbrella_config_args}}
{{supervisor_conditional_user}}
redirect_stderr=true
stdout_logfile={{log_dir}}/%(program_name)s.log
Expand All @@ -118,7 +118,7 @@ logfile_maxbytes=0
startsecs=10

[program:log-processor]
command=api-umbrella-log-processor {{api_umbrella_config_args}}
command={{router.dir}}/bin/api-umbrella-log-processor {{api_umbrella_config_args}}
{{supervisor_conditional_user}}
redirect_stderr=true
stdout_logfile={{log_dir}}/%(program_name)s.log
Expand All @@ -127,7 +127,7 @@ logfile_maxbytes=0
startsecs=10

[program:distributed-rate-limits-sync]
command=api-umbrella-distributed-rate-limits-sync {{api_umbrella_config_args}}
command={{router.dir}}/node_modules/.bin/api-umbrella-distributed-rate-limits-sync {{api_umbrella_config_args}}
{{supervisor_conditional_user}}
redirect_stderr=true
stdout_logfile={{log_dir}}/%(program_name)s.log
Expand Down

0 comments on commit 00d849d

Please sign in to comment.