sync_listing_order_Retry.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. days = -4
  7. for d_ in (-2,-3,-4,-5):
  8. try:
  9. sp_api_client.SpApiRequest.get_allShops("GET_FBA_FULFILLMENT_CUSTOMER_RETURNS_DATA",days=d_,**{})
  10. except Exception as e:
  11. print(e)
  12. try:
  13. sp_api_client.SpApiRequest.get_allShops("GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE",days=d_,**{})
  14. except Exception as e:
  15. print(e)
  16. try:
  17. sp_api_client.SpApiRequest.get_allShops("GET_SELLER_FEEDBACK_DATA",days=d_,**{})
  18. except Exception as e:
  19. print(e)
  20. try:
  21. sp_api_client.SpApiRequest.get_allShops("GET_FLAT_FILE_OPEN_LISTINGS_DATA",days=-2,**{})
  22. except Exception as e:
  23. print(e)
  24. try:
  25. sp_api_client.SpApiRequest.get_allShops("GET_SALES_AND_TRAFFIC_REPORT",days=days,**{"level":"SKU"})
  26. sp_api_client.SpApiRequest.get_allShops("GET_SALES_AND_TRAFFIC_REPORT",days=days,**{"level":"PARENT"})
  27. sp_api_client.SpApiRequest.get_allShops("GET_SALES_AND_TRAFFIC_REPORT",days=days,**{"level":"CHILD"})
  28. except Exception as e:
  29. print(e)
  30. print("-"*40)
  31. try:
  32. sp_api_client.SpApiRequest.get_allShops("GET_FLAT_FILE_OPEN_LISTINGS_DATA")
  33. except Exception as e:
  34. print(e)
  35. print("="*40)
  36. try:
  37. sp_api_client.SpApiRequest.listing_infoTable()
  38. except Exception as e:
  39. print(e)
  40. # func_run()
  41. #
  42. if __name__ == '__main__':
  43. sched = BlockingScheduler()
  44. sched.add_job(func_run,'cron',hour=18,minute=0,second=0)
  45. sched.start()