Compare commits

..

2 Commits

Author SHA1 Message Date
zwitschi 1dcd80a8bb feat: add testing job to build-container workflow and remove redundant push trigger from test-application workflow
Build and Deploy Docker Container / test (push) Failing after 26s
Build and Deploy Docker Container / build-and-deploy (push) Has been skipped
2026-05-10 11:34:27 +02:00
zwitschi c15e9bbd7c fix: improve logging and pagination logic in delete_old_messages function 2026-05-10 11:32:24 +02:00
3 changed files with 27 additions and 12 deletions
+24
View File
@@ -7,7 +7,31 @@ on:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install pytest
- name: Run tests
run: |
source venv/bin/activate
pytest --maxfail=1 --disable-warnings -q
build-and-deploy:
needs: test
runs-on: ubuntu-latest
steps:
- name: Check out repository code
-3
View File
@@ -4,9 +4,6 @@ on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
+2 -8
View File
@@ -539,17 +539,11 @@ def delete_old_messages(minutes: int = 6) -> None:
headers, DISCORD_CHANNEL_ID, webhook_id, author_id, cutoff, last_message_id
)
# Exit loop if no more messages to delete
# Stop scanning when a page has no eligible messages to delete.
# Continuing pagination here can walk indefinitely through history.
if not delete_list:
if deleted_count == 0:
if next_last_message_id is None or next_last_message_id == last_message_id:
logging.info("No messages to delete.")
break
else:
logging.info(
"No messages deleted in this batch, but more messages may exist... Continuing pagination.")
last_message_id = next_last_message_id
continue
else:
logging.info("No more messages to delete.")
break