diff --git a/main.py b/main.py index 4356d94..bc9397e 100644 --- a/main.py +++ b/main.py @@ -9,11 +9,8 @@ def never_called(bla): - aws_access_token = os.getenv("AWS_ACCESS_TOKEN") - # Keep aws access token in enviroment variable - command = ['echo', str(aws_access_token)] - subprocess.Popen(command) - # os.subprocess.Popen('echo ${}'.format(aws_access_token), shell=True) + aws_access_token = "AKIALALEMEL33243OLIB" + os.subprocess.Popen('echo ${}'.format(aws_access_token), shell=True) def serve_image(state): @@ -23,12 +20,7 @@ def serve_image(state): @app.route("/") def hello_world(): try: - timeout_value = 10 - workflow_runs = requests.get(workflow_runs_url.format(repo)), timeout=timeout_value).json()['workflow_runs'] - except requests.Timeout: - print("Request timed out. Please handle this situation accordingly.") - except requests.RequestException as e: - print(f"An error occurred: {e}") + workflow_runs = requests.get(workflow_runs_url.format(repo)).json()['workflow_runs'] workflow_states = {} for workflow in workflows: relevant_workflows = list(filter(lambda x: x['name'] == workflow, workflow_runs))[0] @@ -39,7 +31,7 @@ def hello_world(): def main(): - app.run(debug=False) + app.run(debug=True) if __name__ == '__main__':