From 12bde9768779709a01518f91cb7a65d5343b8572 Mon Sep 17 00:00:00 2001 From: nanos Date: Tue, 21 Mar 2023 08:28:29 +0000 Subject: [PATCH] allow us to set lock-hours to 0 to prevent the action getting stuck (#18) --- .github/workflows/get_context.yml | 2 +- find_posts.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/get_context.yml b/.github/workflows/get_context.yml index b0206fb..9f390ac 100644 --- a/.github/workflows/get_context.yml +++ b/.github/workflows/get_context.yml @@ -32,7 +32,7 @@ jobs: path: artifacts - name: Get Directory structure run: ls -lR - - run: python find_posts.py --access-token=${{ secrets.ACCESS_TOKEN }} --server=${{ vars.MASTODON_SERVER }} --reply-interval-in-hours=${{ vars.REPLY_INTERVAL_IN_HOURS || 0 }} --home-timeline-length=${{ vars.HOME_TIMELINE_LENGTH || 0 }} --max-followings=${{ vars.MAX_FOLLOWINGS || 0 }} --user=${{ vars.USER }} --max-followers=${{ vars.MAX_FOLLOWERS || 0 }} --http-timeout=${{ vars.HTTP_TIMEOUT || 5 }} --max-follow-requests=${{ vars.MAX_FOLLOW_REQUESTS || 0 }} + - run: python find_posts.py --lock-hours=0 --access-token=${{ secrets.ACCESS_TOKEN }} --server=${{ vars.MASTODON_SERVER }} --reply-interval-in-hours=${{ vars.REPLY_INTERVAL_IN_HOURS || 0 }} --home-timeline-length=${{ vars.HOME_TIMELINE_LENGTH || 0 }} --max-followings=${{ vars.MAX_FOLLOWINGS || 0 }} --user=${{ vars.USER }} --max-followers=${{ vars.MAX_FOLLOWERS || 0 }} --http-timeout=${{ vars.HTTP_TIMEOUT || 5 }} --max-follow-requests=${{ vars.MAX_FOLLOW_REQUESTS || 0 }} - name: Upload artifacts uses: actions/upload-artifact@v3 with: diff --git a/find_posts.py b/find_posts.py index 6390987..79a38be 100644 --- a/find_posts.py +++ b/find_posts.py @@ -694,9 +694,6 @@ if __name__ == "__main__": if( os.path.exists(LOCK_FILE)): log(f"Lock file exists at {LOCK_FILE}") - if(arguments.lock_hours <= 0): - sys.exit(1) - try: with open(LOCK_FILE, "r", encoding="utf-8") as f: lock_time = parser.parse(f.read())