From f46d77d9c0938b0ab31462d7367b5a0edfddac32 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 22 Jun 2024 11:16:20 -0400 Subject: [PATCH] only show post in last 90 days when showing profile --- compose.yml | 6 +++--- neodb-takahe | 2 +- takahe/utils.py | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/compose.yml b/compose.yml index 2d17d191..3f7af0b9 100644 --- a/compose.yml +++ b/compose.yml @@ -164,7 +164,7 @@ services: neodb-web: <<: *neodb-service - command: ${NEODB_VENV:-/neodb-venv}/bin/gunicorn boofilsic.wsgi -w ${NEODB_WEB_WORKER_NUM:-8} --preload --max-requests 2000 --timeout 90 -b 0.0.0.0:8000 + command: ${NEODB_VENV:-/neodb-venv}/bin/gunicorn boofilsic.wsgi -w ${NEODB_WEB_WORKER_NUM:-8} --preload --max-requests 2000 --timeout 60 -b 0.0.0.0:8000 healthcheck: test: ['CMD', 'wget', '-qO/tmp/test', '--header', 'X-Forwarded-Proto: https', 'http://127.0.0.1:8000/nodeinfo/2.0/'] depends_on: @@ -173,7 +173,7 @@ services: neodb-web-api: <<: *neodb-service - command: ${NEODB_VENV:-/neodb-venv}/bin/gunicorn boofilsic.wsgi -w ${NEODB_API_WORKER_NUM:-4} --preload --max-requests 2000 --timeout 90 -b 0.0.0.0:8000 + command: ${NEODB_VENV:-/neodb-venv}/bin/gunicorn boofilsic.wsgi -w ${NEODB_API_WORKER_NUM:-4} --preload --max-requests 2000 --timeout 30 -b 0.0.0.0:8000 healthcheck: test: ['CMD', 'wget', '-qO/tmp/test', '--header', 'X-Forwarded-Proto: https', 'http://127.0.0.1:8000/nodeinfo/2.0/'] depends_on: @@ -196,7 +196,7 @@ services: takahe-web: <<: *neodb-service - command: ${TAKAHE_VENV:-/takahe-venv}/bin/gunicorn --chdir /takahe takahe.wsgi -w ${TAKAHE_WEB_WORKER_NUM:-8} --max-requests 2000 --timeout 90 --preload -b 0.0.0.0:8000 + command: ${TAKAHE_VENV:-/takahe-venv}/bin/gunicorn --chdir /takahe takahe.wsgi -w ${TAKAHE_WEB_WORKER_NUM:-8} --max-requests 2000 --timeout 60 --preload -b 0.0.0.0:8000 healthcheck: test: ['CMD', 'wget', '-qO/tmp/test', '--header', 'X-Forwarded-Proto: https', 'http://127.0.0.1:8000/api/v1/instance'] depends_on: diff --git a/neodb-takahe b/neodb-takahe index 65f4163e..005dc7b6 160000 --- a/neodb-takahe +++ b/neodb-takahe @@ -1 +1 @@ -Subproject commit 65f4163e5f6a5b4c4d6af8c9825681d9005189ba +Subproject commit 005dc7b61b37ad6f3f4bd2bf4c8b1322a1de8595 diff --git a/takahe/utils.py b/takahe/utils.py index 65043638..e1c5d9ce 100644 --- a/takahe/utils.py +++ b/takahe/utils.py @@ -937,9 +937,11 @@ class Takahe: @staticmethod def get_recent_posts(author_pk: int, viewer_pk: int | None = None): + since = timezone.now() - timedelta(days=90) qs = ( Post.objects.exclude(state__in=["deleted", "deleted_fanned_out"]) .filter(author_id=author_pk) + .filter(published__gte=since) .order_by("-published") ) if viewer_pk and Takahe.get_is_following(viewer_pk, author_pk):