add status for ton_daemon
This commit is contained in:
parent
b63f663bd2
commit
54bc545090
|
|
@ -54,7 +54,7 @@ async def s_api_v1_node_friendly(request):
|
||||||
for service_key, service in request.app.ctx.memory.known_states.items():
|
for service_key, service in request.app.ctx.memory.known_states.items():
|
||||||
response_plain_text += f"""
|
response_plain_text += f"""
|
||||||
{service_key}:
|
{service_key}:
|
||||||
status: {service['status'] if (service['timestamp'] and (datetime.now() - service['timestamp']).total_seconds() < 30) else 'not working: timeout'}
|
status: {service['status'] if (service['timestamp'] and (datetime.now() - service['timestamp']).total_seconds() < 120) else 'not working: timeout'}
|
||||||
delay: {round((datetime.now() - service['timestamp']).total_seconds(), 3) if service['timestamp'] else -1}
|
delay: {round((datetime.now() - service['timestamp']).total_seconds(), 3) if service['timestamp'] else -1}
|
||||||
"""
|
"""
|
||||||
return response.text(response_plain_text, content_type='text/plain')
|
return response.text(response_plain_text, content_type='text/plain')
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ async def main_fn(memory):
|
||||||
|
|
||||||
with db_session() as session:
|
with db_session() as session:
|
||||||
# Проверка отправленных сообщений
|
# Проверка отправленных сообщений
|
||||||
|
await send_status("ton_daemon", f"working: processing in-txs (seqno={sw_seqno_value})")
|
||||||
async def process_incoming_transaction(transaction: dict):
|
async def process_incoming_transaction(transaction: dict):
|
||||||
transaction_hash = transaction['transaction_id']['hash']
|
transaction_hash = transaction['transaction_id']['hash']
|
||||||
transaction_lt = str(transaction['transaction_id']['lt'])
|
transaction_lt = str(transaction['transaction_id']['lt'])
|
||||||
|
|
@ -174,6 +175,7 @@ async def main_fn(memory):
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
make_log("TON_Daemon", f"Error while getting service wallet transactions: {e}", level="ERROR")
|
make_log("TON_Daemon", f"Error while getting service wallet transactions: {e}", level="ERROR")
|
||||||
|
|
||||||
|
await send_status("ton_daemon", f"working: processing out-txs (seqno={sw_seqno_value})")
|
||||||
# Отправка подписанных сообщений
|
# Отправка подписанных сообщений
|
||||||
for blockchain_task in (
|
for blockchain_task in (
|
||||||
session.query(BlockchainTask).filter(
|
session.query(BlockchainTask).filter(
|
||||||
|
|
@ -213,6 +215,7 @@ async def main_fn(memory):
|
||||||
|
|
||||||
await asyncio.sleep(0.5)
|
await asyncio.sleep(0.5)
|
||||||
|
|
||||||
|
await send_status("ton_daemon", f"working: creating new messages (seqno={sw_seqno_value})")
|
||||||
# Создание новых подписей
|
# Создание новых подписей
|
||||||
for blockchain_task in (
|
for blockchain_task in (
|
||||||
session.query(BlockchainTask).filter(BlockchainTask.status == 'wait').all()
|
session.query(BlockchainTask).filter(BlockchainTask.status == 'wait').all()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue