Created
October 6, 2010 18:05
-
-
Save jdunphy/613804 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handle_info({bee_updated_normally, #bee{revision = Sha} = Bee, #app{name = AppName} = App, Caller}, State) -> | |
% StartedBee#bee{revision = Sha}, App#app{revision = Sha} | |
?LOG(debug, "app_event_handler got bee_updated_normally: ~p, ~p", [Bee, App]), | |
case apps:find_by_name(AppName) of | |
RealApp when is_record(RealApp, app) -> | |
apps:save(RealApp#app{revision = Sha, latest_error = undefined}); | |
_ -> ok | |
end, | |
case bees:find_by_id(Bee#bee.id) of | |
RealBee when is_record(RealBee, bee) -> bees:save(RealBee#bee{lastresp_time = date_util:now_to_seconds()}); | |
_ -> ok | |
end, | |
Caller ! {bee_updated_normally, Bee, App}, | |
ok = kill_other_bees(Bee), | |
{noreply, State}; | |
handle_info({bee_started_normally, Bee, App, Caller}, State) -> | |
?LOG(debug, "Bee started normally: ~p", [Bee]), | |
Caller ! {bee_started_normally, Bee, App}, | |
{noreply, State}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/erlang/apps/beehive/src/beehive/app_manager.erl b/lib/erlang/apps/beehive/src/beehive/app_manager.erl | |
index 38df752..da9374f 100644 | |
--- a/lib/erlang/apps/beehive/src/beehive/app_manager.erl | |
+++ b/lib/erlang/apps/beehive/src/beehive/app_manager.erl | |
@@ -675,8 +675,10 @@ app_launcher_fsm_go(Method, App, Caller, Updating) -> | |
process_flag(trap_exit, true), | |
% Now = date_util:now_to_seconds(), | |
StartOpts = [{app, App}, {caller, Caller}, {from, self()}, {updating, Updating}], | |
+ ?LOG(debug, "wtfers ~p", [StartOpts]), | |
case app_launcher_fsm:start_link(StartOpts) of | |
{ok, P} -> | |
+ ?LOG(debug, "wtfers ~p", [P]), | |
erlang:link(P), | |
rpc:call(node(P), app_launcher_fsm, Method, [P]), | |
{ok, P}; | |
diff --git a/lib/erlang/apps/beehive/src/bh_events/events/app_event_handler.erl b/lib/erlang/apps/beehive/src/bh_events/events/app_event_handler.erl | |
index ccc1472..2f43708 100644 | |
--- a/lib/erlang/apps/beehive/src/bh_events/events/app_event_handler.erl | |
+++ b/lib/erlang/apps/beehive/src/bh_events/events/app_event_handler.erl | |
@@ -63,10 +63,10 @@ handle_event({app, updated_revision, App}, State) -> | |
% THIS NEEDS TO BE FEDERATED... | |
handle_event({app, request_to_start_new_bee, App}, State) when is_record(App, app) -> | |
- app_manager:request_to_start_new_bee_by_app(App), | |
+ app_manager:request_to_start_new_bee_by_app(App, self()), | |
{ok, State}; | |
handle_event({app, request_to_start_new_bee, Hostname}, State) -> | |
- app_manager:request_to_start_new_bee_by_name(Hostname), | |
+ app_manager:request_to_start_new_bee_by_name(Hostname, self()), | |
{ok, State}; | |
handle_event(_Event, State) -> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment