def update(): time.sleep(5) last_updated = db.info.last_updated() time_since_update = datetime.utcnow() - last_updated if time_since_update.days >= 1: db.requests.update() if pb.enabled: pb.populate()
tablefmt='psql', headers='keys')) if __name__ == '__main__': from utils.log import log_heading import time from settings import Server time.sleep(1) log_heading('checks') check_db_version() check_db_update() # log_heading('database contents') # show_db_contents() if not Server.UPDATE_ON_START: import pb if not pb.enabled: pb.clear_data() elif not pb.available(): pb.populate() from utils.settings import log_settings log_heading('settings') log_settings() log_heading('starting server')