You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2018/02/01 18:52:26 UTC
[whimsy] branch master updated: restart passenger applications if a
library source changes
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 5fe6350 restart passenger applications if a library source changes
5fe6350 is described below
commit 5fe6350f907db269a8d7ab3862332cd4061c1b1a
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Thu Feb 1 13:52:08 2018 -0500
restart passenger applications if a library source changes
---
Rakefile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Rakefile b/Rakefile
index 04a4ca6..963d56d 100644
--- a/Rakefile
+++ b/Rakefile
@@ -13,11 +13,14 @@ task :update, [:command] do |task, args|
new_baseline = Time.now
old_baseline = File.mtime(update_file) rescue Time.at(0)
+ # determine last update time of library sources
+ lib_update = Dir['lib/**/*'].map {|n| File.mtime n rescue Time.at(0)}.max
+
# restart passenger applications that have changed since the last update
Dir['**/config.ru'].each do |rackapp|
Dir.chdir File.dirname(rackapp) do
last_update = Dir['**/*'].map {|n| File.mtime n rescue Time.at(0)}.max
- if last_update > old_baseline and Dir.exist? 'tmp'
+ if [lib_update, last_update].max > old_baseline and Dir.exist? 'tmp'
FileUtils.touch 'tmp/.restart.txt'
FileUtils.chmod 0777, 'tmp/.restart.txt'
FileUtils.mv 'tmp/.restart.txt', 'tmp/restart.txt'
--
To stop receiving notification emails like this one, please contact
rubys@apache.org.