19 lines
471 B
Python
19 lines
471 B
Python
|
from core.lib.elastic import store_msg
|
||
|
|
||
|
|
||
|
def get_balance_hook(user_id, user_name, account_id, account_name, balance):
|
||
|
"""
|
||
|
Called every time the balance is fetched on an account.
|
||
|
Store this into Elasticsearch.
|
||
|
"""
|
||
|
store_msg(
|
||
|
"balances",
|
||
|
{
|
||
|
"user_id": user_id,
|
||
|
"user_name": user_name,
|
||
|
"account_id": account_id,
|
||
|
"account_name": account_name,
|
||
|
"balance": balance,
|
||
|
},
|
||
|
)
|