move parse_static_data so that it runs whenever an app_dir is set up or redeployed
@@ -1843,6 +1843,23 @@ class Djinn
return if apps_to_restart.empty?
Djinn.log_info("Notify nodes to restart #{apps_to_restart}.")
+ # Self needs to update source code/cache.
+ if my_node.is_load_balancer?
+ apps_to_restart.each{ |app|
+ begin
+ HelperFunctions.parse_static_data(app, true)
+ rescue => except
+ # This specific exception may be a JSON parse error.
+ error_msg = "ERROR: Unable to parse app.yaml file for #{app}. "\
+ "Exception of #{except.class} with message #{except.message}"
+
+ end
+ unless error_msg.empty?
+ # Something went wrong: place the error applcation instead.
+ place_error_app(app, error_msg, get_app_language(app))
+ end
+ }
+ end
threads = []
@nodes.each_index { |index|
result = ""
@@ -5906,23 +5923,22 @@ HOSTS
error_msg = "ERROR: couldn't setup source for #{app} " +
"(#{exception.message})."
end
+ end
+ else
+ # If we couldn't get a copy of the application, place a dummy error
+ # application to inform the user we had issues.
+ error_msg = "ERROR: Failed to copy app: #{app}."
+ end
+ end
+ if remove_old and my_node.is_load_balancer?
begin
HelperFunctions.parse_static_data(app, true)
rescue => except
# This specific exception may be a JSON parse error.
error_msg = "ERROR: Unable to parse app.yaml file for #{app}. "\
"Exception of #{except.class} with message #{except.message}"
- place_error_app(app, error_msg, app_language)
end
end
- else
- # If we couldn't get a copy of the application, place a dummy error
- # application to inform the user we had issues.
- error_msg = "ERROR: Failed to copy app: #{app}."
- end
- end
-
-
unless error_msg.empty?
# Something went wrong: place the error applcation instead.
place_error_app(app, error_msg, get_app_language(app))
