anchor.diff:  -export([check_config/0]).
   
   -define(TRACE1(X), ?TRACE(X, [])).
  -%% -define(TRACE(X,Y), io:format("as: " ++ X ++ "~n",Y)).
  +%%-define(TRACE(X,Y), io:format("as: " ++ X ++ "~n",Y)).
   -define(TRACE(_X,_Y), ok).
   
   -define(CLOUD, (config:read(autoscale_cloud_module))).
   %% Tx key for writing updates of alarms to dht 
   -define(AUTOSCALE_TX_KEY,
           "d9c966df633f8b1577eacff013166db95917a7002999b6fbbb67a3dd572d5035").
  +%% Default timeout when pulling scale requests
  +-define(DEFAULT_LOCK_TIMEOUT, 60).
   
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %% Types
  
positive.code:   when ScaleReq#scale_req.lock =:= unlocked ->
      comm:send(Pid, {scale_req_resp, ok}),
      % start timeout @todo add timeout to cofig
      Trigger = comm:send_local_after(60*1000, self(),
                                      {unlock_scale_req_timeout}),
      ?TRACE("lock_scale_req,~nscale_req: ~p", [ScaleReq]),
      {_IsLeader, _Alarms, ScaleReq#scale_req{lock = locked},
  
negative.code: 
      % intial state
      {_IsLeader = false,
       _Alarms   = get_alarms(),
       _ScaleReq =
           case ?CLOUD =:= cloud_cps of
               true  -> #scale_req{mode = pull};
  