add minimal error check on config

This commit is contained in:
Morgan McMillian 2021-11-20 10:57:50 -08:00
parent 1249c8347a
commit dff2cbbc7c

View file

@ -397,6 +397,11 @@ def main():
Base.query = db_session.query_property() Base.query = db_session.query_property()
Base.metadata.create_all(bind=engine) Base.metadata.create_all(bind=engine)
if len(config['ACCESS_TOKEN']) <= 1:
logger.error("Error, invalid access token")
logger.error(f"You may not have updated " + filename)
exit(-1)
pnutpy.api.add_authorization_token(config['ACCESS_TOKEN']) pnutpy.api.add_authorization_token(config['ACCESS_TOKEN'])
ws_url = "wss://stream.pnut.io/v1/user" ws_url = "wss://stream.pnut.io/v1/user"