sync_get_open_listing_data.py 671 B

12345678910111213141516171819202122
  1. import warnings
  2. warnings.filterwarnings('ignore')
  3. from apscheduler.schedulers.blocking import BlockingScheduler
  4. from sync_amz_data.public import sp_api_client
  5. def func_run():
  6. try:
  7. sp_api_client.SpApiRequest.get_allShops("GET_FLAT_FILE_OPEN_LISTINGS_DATA")
  8. except:
  9. sp_api_client.SpApiRequest.get_allShops("GET_FLAT_FILE_OPEN_LISTINGS_DATA")
  10. print("="*40)
  11. try:
  12. sp_api_client.SpApiRequest.listing_infoTable()
  13. except:
  14. sp_api_client.SpApiRequest.listing_infoTable()
  15. # func_run()
  16. if __name__ == '__main__':
  17. sched = BlockingScheduler()
  18. sched.add_job(func_run,'cron',hour=4,minute=30,second=0)
  19. sched.start()