From 0d95631980de13b07386460bd4a0d04c0bd562d5 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 22 Mar 2023 07:24:47 +0000 Subject: [PATCH 1/4] Disable keepalive This is causing an error (#23) because we aren't actually checking out the repo. Need to revisit at a later stage. --- .github/workflows/get_context.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/get_context.yml b/.github/workflows/get_context.yml index e0b8f3f..6b5a784 100644 --- a/.github/workflows/get_context.yml +++ b/.github/workflows/get_context.yml @@ -39,5 +39,5 @@ jobs: name: artifacts path: | artifacts - - name: Keep workflow alive - uses: gautamkrishnar/keepalive-workflow@v1 +# - name: Keep workflow alive +# uses: gautamkrishnar/keepalive-workflow@v1 From 3491c6a7e24b5727ef0b68d10237041c68e5f680 Mon Sep 17 00:00:00 2001 From: nanos Date: Wed, 22 Mar 2023 11:40:07 +0000 Subject: [PATCH 2/4] don't attempt to send beacon if urls are empty string --- find_posts.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/find_posts.py b/find_posts.py index 90b0997..a0cd552 100644 --- a/find_posts.py +++ b/find_posts.py @@ -707,7 +707,7 @@ if __name__ == "__main__": runId = uuid.uuid4() - if(arguments.on_start != None): + if(arguments.on_start != None and arguments.on_start != ''): try: get(f"{arguments.on_start}?rid={runId}") except Exception as ex: @@ -727,7 +727,7 @@ if __name__ == "__main__": log(f"Lock file has expired. Removed lock file.") else: log(f"Lock file age is {datetime.now() - lock_time} - below --lock-hours={arguments.lock_hours} provided.") - if(arguments.on_fail != None): + if(arguments.on_fail != None and arguments.on_fail != ''): try: get(f"{arguments.on_fail}?rid={runId}") except Exception as ex: @@ -736,7 +736,7 @@ if __name__ == "__main__": except Exception: log(f"Cannot read logfile age - aborting.") - if(arguments.on_fail != None): + if(arguments.on_fail != None and arguments.on_fail != ''): try: get(f"{arguments.on_fail}?rid={runId}") except Exception as ex: @@ -794,7 +794,7 @@ if __name__ == "__main__": os.remove(LOCK_FILE) - if(arguments.on_done != None): + if(arguments.on_done != None and arguments.on_done != ''): try: get(f"{arguments.on_done}?rid={runId}") except Exception as ex: @@ -805,7 +805,7 @@ if __name__ == "__main__": except Exception as ex: os.remove(LOCK_FILE) log(f"Job failed after {datetime.now() - start}.") - if(arguments.on_fail != None): + if(arguments.on_fail != None and arguments.on_fail != ''): try: get(f"{arguments.on_fail}?rid={runId}") except Exception as ex: From e2b4addcfcbb09ca6cd17396ed5eecfa72b0c431 Mon Sep 17 00:00:00 2001 From: nanos Date: Thu, 23 Mar 2023 07:06:14 +0000 Subject: [PATCH 3/4] Try again to keep workflow alive Fixes #24 --- .github/workflows/get_context.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/get_context.yml b/.github/workflows/get_context.yml index 6b5a784..6dad729 100644 --- a/.github/workflows/get_context.yml +++ b/.github/workflows/get_context.yml @@ -39,5 +39,7 @@ jobs: name: artifacts path: | artifacts -# - name: Keep workflow alive -# uses: gautamkrishnar/keepalive-workflow@v1 + - name: Check out, so that we can keep the workflow alive + uses: actions/checkout@v3 + - name: Keep workflow alive + uses: gautamkrishnar/keepalive-workflow@v1 From 6953672df4091f3ee7bf7aa8bf6e13c02ba1299e Mon Sep 17 00:00:00 2001 From: nanos Date: Thu, 23 Mar 2023 07:09:30 +0000 Subject: [PATCH 4/4] use curl's retry mechanism when getting the release addresses #25 --- .github/workflows/get_context.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/get_context.yml b/.github/workflows/get_context.yml index 6dad729..10fbc08 100644 --- a/.github/workflows/get_context.yml +++ b/.github/workflows/get_context.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Get latest release run: | - curl -s https://api.github.com/repos/nanos/mastodon_get_replies/releases/latest | jq .zipball_url | xargs wget -O download.zip + curl --retry 20 -s https://api.github.com/repos/nanos/mastodon_get_replies/releases/latest | jq .zipball_url | xargs wget -O download.zip unzip -j download.zip mkdir artifacts ls -lR