12345678910111213141516171819202122232425262728293031323334353637 |
- from market import Market
- from player import Player
- import schedule
- import time
- from datetime import datetime
- from logger import logger
- m=Market()
- p=Player()
- def jobM():
- logger.info("Gathering Market Data.")
- try:
- m.fetchData()
- m.commit()
- logger.info("Complete.")
- except Exception as e:
- logger.error(f"{e}")
- def jobP():
- logger.info("Gathering Player Data.")
- try:
- p.fetchData()
- p.commit()
- logger.info("Complete.")
- except Exception as e:
- logger.error(f"{e}")
- schedule.every(15).minutes.do(jobM)
- schedule.every(15).minutes.do(jobP)
- jobM()
- jobP()
- while 1:
- schedule.run_pending()
- time.sleep(1)
|