__main__.py 615 B

123456789101112131415161718192021222324252627282930
  1. """Main app"""
  2. import time
  3. import sys
  4. from app import SCHEDULER, LOGGER, jobs
  5. if __name__ == '__main__':
  6. LOGGER.info('Starting application')
  7. # jobs.sync_deep_exploration(4002)
  8. # jobs.start_deep_exploration_order(2)
  9. # sys.exit()
  10. jobs.schedule_orders()
  11. # backup job to reschedule orders
  12. SCHEDULER.add_job(
  13. jobs.schedule_orders,
  14. 'cron',
  15. id='schedule_orders',
  16. hour='3'
  17. )
  18. try:
  19. while True:
  20. time.sleep(100)
  21. except KeyboardInterrupt:
  22. LOGGER.info('Exiting application')
  23. SCHEDULER.shutdown()
  24. sys.exit()