Skip to content

Commit

Permalink
read session configuration everytime we run a action (#114)
Browse files Browse the repository at this point in the history
This makes is possible to change the configuration during the lifetime
of a session and have the new config apply to that session.
  • Loading branch information
RoadRunnr authored Jan 28, 2021
1 parent 6ccf60c commit 691ae03
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ergw_aaa_session.erl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
-include_lib("kernel/include/logger.hrl").
-include("include/ergw_aaa_session.hrl").

-record(data, {'$version' = 1,
-record(data, {'$version' = 2,
owner,
owner_monitor,
application,
Expand Down Expand Up @@ -193,7 +193,7 @@ init([Owner, SessionOpts]) ->
Data = #data{
owner = Owner,
owner_monitor = MonRef,
application = App,
application = AppId,
handlers = #{},
session = DefaultSessionOpts
},
Expand Down Expand Up @@ -422,7 +422,8 @@ services(Procedure, App) ->
Procedures = maps:get(procedures, App, #{}),
maps:get(Procedure, Procedures, []).

action(Procedure, Opts, #data{application = App} = Data) ->
action(Procedure, Opts, #data{application = AppId} = Data) ->
App = ergw_aaa_config:get_application(AppId),
Pipeline = services(Procedure, App),
pipeline(Procedure, Data, [], Opts, Pipeline).

Expand Down

0 comments on commit 691ae03

Please sign in to comment.