From 0612bf31848ebc1a9b96c99fa892184a6b697422 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 3 Feb 2020 20:45:27 +1300 Subject: [PATCH] Add support for restarting the application server using bake. --- falcon.gemspec | 1 + lib/falcon/command/supervisor.rb | 2 ++ recipes/falcon/supervisor.rb | 6 ++++++ 3 files changed, 9 insertions(+) create mode 100644 recipes/falcon/supervisor.rb diff --git a/falcon.gemspec b/falcon.gemspec index 96f52c96..9c99d9ab 100644 --- a/falcon.gemspec +++ b/falcon.gemspec @@ -36,6 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency "async-websocket", "~> 0.12.0" spec.add_development_dependency "async-process", "~> 1.1" + spec.add_development_dependency "bake" spec.add_development_dependency "covered", "~> 0.10" spec.add_development_dependency "bundler" spec.add_development_dependency "rspec", "~> 3.6" diff --git a/lib/falcon/command/supervisor.rb b/lib/falcon/command/supervisor.rb index c049ef82..672804ca 100644 --- a/lib/falcon/command/supervisor.rb +++ b/lib/falcon/command/supervisor.rb @@ -21,6 +21,8 @@ require 'samovar' require 'async' require 'json' + +require 'async/io/stream' require 'async/io/unix_endpoint' module Falcon diff --git a/recipes/falcon/supervisor.rb b/recipes/falcon/supervisor.rb new file mode 100644 index 00000000..16507dc8 --- /dev/null +++ b/recipes/falcon/supervisor.rb @@ -0,0 +1,6 @@ + +recipe :restart, description: 'Restart the application server via the supervisor.' do + require_relative '../../lib/falcon/command/supervisor' + + Falcon::Command::Supervisor["restart"].call +end