dev@locazia: add service healthy montoring
This commit is contained in:
1 parent
e0a4514fef
commit
fcc5ccbe65
9 files changed
+139
-16
No files matched your search
@@ -1,11 +1,16 @@
|
||||
|
||||
from app.core._utils.send_status import send_status
|
||||
from app.core.logger import make_log
|
||||
import asyncio
|
||||
|
||||
|
||||
async def main():
|
||||
make_log("Indexator", "Service started", level="info")
|
||||
seqno = 0
|
||||
while True:
|
||||
|
||||
await asyncio.sleep(5)
|
||||
await send_status("indexator", f"working (seqno={seqno})")
|
||||
seqno += 1
|
||||
|
||||
if __name__ == '__main__':
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
@@ -4,6 +4,8 @@ from app.core._config import MY_FUND_ADDRESS
|
||||
from app.core.storage import db_session
|
||||
from app.core._secrets import service_wallet
|
||||
from app.core._blockchain.ton.toncenter import toncenter
|
||||
from app.core._utils.send_status import send_status
|
||||
|
||||
import asyncio
|
||||
import os, sys
|
||||
|
||||
@@ -48,16 +50,20 @@ async def main():
|
||||
}], sw_seqno_value
|
||||
)['message'].to_boc(False)
|
||||
)
|
||||
|
||||
sw_seqno_value += 1
|
||||
make_log("TON", "Withdraw command sent", level="info")
|
||||
await asyncio.sleep(10)
|
||||
|
||||
while True:
|
||||
make_log("TON", "Service running", level="debug")
|
||||
sw_seqno_value = await get_sw_seqno()
|
||||
make_log("TON", "Service running (seqno+{", level="debug")
|
||||
# with db_session() as session:
|
||||
# for stored_content in session.query(StoredContent).filter(StoredContent.uploaded == False).all():
|
||||
# pass
|
||||
|
||||
await asyncio.sleep(5)
|
||||
await send_status("ton", f"working (seqno={sw_seqno_value})")
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from app.core._utils.send_status import send_status
|
||||
|
||||
from app.core.logger import make_log
|
||||
from app.core.storage import db_session
|
||||
@@ -6,6 +7,7 @@ import asyncio
|
||||
|
||||
async def main():
|
||||
make_log("Uploader", "Service started", level="info")
|
||||
seqno = 0
|
||||
while True:
|
||||
# make_log("Uploader", "Service running", level="debug")
|
||||
# with db_session() as session:
|
||||
@@ -13,6 +15,8 @@ async def main():
|
||||
# pass
|
||||
|
||||
await asyncio.sleep(5)
|
||||
await send_status("uploader", f"working (seqno={seqno})")
|
||||
seqno += 1
|
||||
|
||||
if __name__ == '__main__':
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
Reference in new issue
Block a user