Jump to content

Edit History

kazte

kazte

Thank you. 

It's good to know jonny5 can terminate calls in progress rather than wait for them to finish. 

The balance check seems to be "by request". Jonny5 has a responder to "j5_balance_check_req". It answers to some request on a higher api for "balance_check_req".

This request seems to come from worker in ecallmgr (ecallmgr_balance_crawler_worker) that issues the balance_check_req via an internal "send_req" function. There's a disconnect_accounts function called in case of a need to disconnect.

Here's an extract from the worker. 

-define(INTERACCOUNT_DELAY_MS, kapps_config:get_integer(?APP_NAME, <<"balance_crawler_interaccount_delay_ms">>, 10)).
-define(FETCH_TIMEOUT_MS, kapps_config:get_integer(?APP_NAME, <<"balance_crawler_fetch_timeout_ms">>, 10000)).

-spec start() -> no_return().
start() ->
    case ecallmgr_fs_channels:per_minute_accounts() of
        [] -> exit('no_accounts');
        Accounts ->
            lager:debug("get balance for ~p account(s)", [length(Accounts)]),
            DisconnectAccounts = send_req(Accounts),
            'ok' = disconnect_accounts(DisconnectAccounts),
            exit('work_done')
    end.

If I read this correctly, all accounts are checked continuously, with a 10ms delay between accounts and a 10 seconds timeout on each request for the balance.

Do I understand correctly, or am I missing something ?

PS: It seems interaccount delay and timeout are read from the ecallmgr config. However the 10ms delay seems to apply to the disconnect function of calls and not to the cheking of balance which seems continuous (without delays). Anyone can confirm this?

kazte

kazte

Thank you. 

It's good to know jonny5 can terminate calls in progress rather than wait for them to finish. 

The balance check seems to be "by request". Jonny5 has a responder to "j5_balance_check_req". It answers to some request on a higher api for "balance_check_req".

This request seems to come from worker in ecallmgr (ecallmgr_balance_crawler_worker) that issues the balance_check_req via an internal "send_req" function. There's a disconnect_accounts function called in case of a need to disconnect.

Here's an extract from the worker. 

-define(INTERACCOUNT_DELAY_MS, kapps_config:get_integer(?APP_NAME, <<"balance_crawler_interaccount_delay_ms">>, 10)).
-define(FETCH_TIMEOUT_MS, kapps_config:get_integer(?APP_NAME, <<"balance_crawler_fetch_timeout_ms">>, 10000)).

-spec start() -> no_return().
start() ->
    case ecallmgr_fs_channels:per_minute_accounts() of
        [] -> exit('no_accounts');
        Accounts ->
            lager:debug("get balance for ~p account(s)", [length(Accounts)]),
            DisconnectAccounts = send_req(Accounts),
            'ok' = disconnect_accounts(DisconnectAccounts),
            exit('work_done')
    end.

If I read this correctly, all accounts are checked continuously, with a 10ms delay between accounts and a 10 seconds timeout on each request for the balance.

Do I understand correctly, or am I missing something ?

kazte

kazte

Thank you. 

It's good to know jonny5 can terminate calls in progress rather than wait for them to finish. 

The balance check seems to be "by request". Jonny5 has a responder to "j5_balance_check_req". It answers to some request on a higher api for "balance_check_req".

This request seems to come from worker in ecallmgr (ecallmgr_balance_crawler_worker) that issues the balance_check_req via an internal "send_req" function. There's a disconnect_accounts function called in case of need to disconnect. Below an extract: 


-define(SERVER, ?MODULE).
-define(INTERACCOUNT_DELAY_MS, kapps_config:get_integer(?APP_NAME, <<"balance_crawler_interaccount_delay_ms">>, 10)).
-define(FETCH_TIMEOUT_MS, kapps_config:get_integer(?APP_NAME, <<"balance_crawler_fetch_timeout_ms">>, 10000)).

-spec start() -> no_return().
start() ->
    case ecallmgr_fs_channels:per_minute_accounts() of
        [] -> exit('no_accounts');
        Accounts ->
            lager:debug("get balance for ~p account(s)", [length(Accounts)]),
            DisconnectAccounts = send_req(Accounts),
            'ok' = disconnect_accounts(DisconnectAccounts),
            exit('work_done')
    end.

If I read this correctly, all accounts are checked continuously, with a 10ms delay between accounts and a 10 seconds timeout on each request for the balance.

Am I missing something ?

×
×
  • Create New...