From fdc31427c75890aed430a7cbd9d0f5d241b109df Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sat, 23 Nov 2024 05:10:51 +0300 Subject: [PATCH] add random wait --- checker.py | 2 ++ playbook.yml | 50 -------------------------------------------------- 2 files changed, 2 insertions(+), 50 deletions(-) diff --git a/checker.py b/checker.py index e2bcc0f..1e7b766 100644 --- a/checker.py +++ b/checker.py @@ -130,6 +130,8 @@ if __name__ == "__main__": ch.setFormatter(formatter) logger.addHandler(ch) + time.sleep(random.randint(1, 600)) + grist_server = "###GRIST_SERVER###" grist_doc_id = "###GRIST_DOC_ID###" grist_api_key = "###GRIST_API_KEY###" diff --git a/playbook.yml b/playbook.yml index 253c385..0d35050 100644 --- a/playbook.yml +++ b/playbook.yml @@ -357,56 +357,6 @@ enabled: yes state: started - - - - -# - name: Check "not have enough balance" -# ansible.builtin.command: docker logs {{ item }} 2>&1 -# register: docker_logs_check -# changed_when: false -# failed_when: '"not have enough balance" in docker_logs_check.stdout' -# with_items: -# - worker -# - worker-1 -# - worker-2 -# -# - name: Wait send to chain success -# ansible.builtin.shell: | -# python3 logs_parser.py 130 -# args: -# chdir: "{{ ansible_env.HOME }}/basic-coin-prediction-node" -# register: docker_logs_check -# changed_when: false -# failed_when: docker_logs_check.rc != 0 -# -# - name: Check updater endpoint -# ansible.builtin.shell: | -# response=$(curl --silent --location --request GET http://localhost:8000/update) && \ -# if [ "$response" != "0" ]; then -# echo "Updater endpoint check failed: $response != 0" -# exit 1 -# fi -# register: updater_shell_response -# retries: 2 -# delay: 60 -# until: updater_shell_response.rc == 0 -# changed_when: false -# -# - name: Check inference endpoint -# ansible.builtin.shell: | -# response=$(curl --silent --location --request GET http://localhost:8000/inference/{{ token }}) && \ -# status=$(curl -o /dev/null -s -w "%{http_code}\\n" http://localhost:8000/inference/{{ token }}) && \ -# if [ "$status" -ne 200 ] || ! echo "$response" | grep -qE '^[0-9]+(\.[0-9]+)?$'; then -# echo "Inference endpoint check failed: status $status, response $response" -# exit 1 -# fi -# register: inference_shell_response -# retries: 2 -# delay: 60 -# failed_when: inference_shell_response.rc != 0 -# changed_when: false - - name: Remove docker login credentials ansible.builtin.file: path: /root/.docker/config.json