installed prisma for py
This commit is contained in:
@ -405,6 +405,15 @@ app = init_app()
|
||||
# Convert Flask app to ASGI
|
||||
asgi_app = WsgiToAsgi(app)
|
||||
|
||||
async def restartable_task(task_func, *args, **kwargs):
|
||||
while True:
|
||||
try:
|
||||
await task_func(*args, **kwargs)
|
||||
except Exception as e:
|
||||
logging.error(f"Error in task {task_func.__name__}: {e}")
|
||||
await telegram_utils.send_telegram_message(f"Error in task {task_func.__name__}: {e}")
|
||||
await asyncio.sleep(5) # Wait before retrying
|
||||
|
||||
async def main():
|
||||
global bot, PROCESSING_LOG, pk
|
||||
|
||||
@ -413,10 +422,11 @@ async def main():
|
||||
await telegram_utils.send_telegram_message("Solana Agent Started. Connecting to mainnet...")
|
||||
|
||||
# Start the log processor
|
||||
asyncio.create_task(watch_for_new_logs())
|
||||
asyncio.create_task(restartable_task(watch_for_new_logs))
|
||||
# process_transaction
|
||||
|
||||
if DO_WATCH_WALLET:
|
||||
asyncio.create_task(restartable_task(SAPI.wallet_watch_loop))
|
||||
await SAPI.wallet_watch_loop()
|
||||
|
||||
def run_asyncio_tasks():
|
||||
|
Reference in New Issue
Block a user