newContentIdTask.py 675 B

1234567891011121314151617181920212223242526
  1. """
  2. @author: luojunhui
  3. """
  4. import time
  5. import datetime
  6. import asyncio
  7. from applications.db import AsyncMySQLClient
  8. from tasks.new_contentId_task import NewContentIdTask
  9. async def main_job():
  10. """
  11. main job
  12. :return:
  13. """
  14. async with AsyncMySQLClient() as long_articles_pool, AsyncMySQLClient(aigc=True) as aigc_pool:
  15. new_content_id_task = NewContentIdTask(long_articles_pool, aigc_pool)
  16. await new_content_id_task.deal()
  17. if __name__ == '__main__':
  18. while True:
  19. asyncio.run(main_job())
  20. now_str = datetime.datetime.now().__str__()
  21. print("{} 请求执行完成, 等待60s".format(now_str))
  22. time.sleep(60)