production-evyos-systems-an.../ServicesRunner/AccountRecordServices/Test/app.py

30 lines
835 B
Python

import asyncio
import sys
from Depends.prisma_client import prisma_client
async def my_function():
try:
async with prisma_client() as db:
result = await db.account_records.find_many(
take=5,
skip=0,
order=[{"bank_date": "desc"}]
)
selected_result = [{"id": record.id, "bank_date": record.bank_date, "currency_value": record.currency_value} for record in result]
for record in selected_result:
print(record)
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
raise
if __name__ == "__main__":
while True:
print("I am online")
asyncio.sleep(30)
# asyncio.run(my_function())
# asyncio.run(my_function())
# while True:
# asyncio.sleep(5)