diff --git a/requirements-dev.lock b/requirements-dev.lock index 6c8fdcd2..ff44b9a7 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -22,9 +22,9 @@ asgiref==3.8.1 attrs==23.2.0 # via aiohttp blurhash-python==1.2.2 -boto3==1.34.91 +boto3==1.34.102 # via django-storages -botocore==1.34.91 +botocore==1.34.102 # via boto3 # via s3transfer cachetools==5.3.3 @@ -44,14 +44,14 @@ charset-normalizer==3.3.2 # via requests click==8.1.7 # via uvicorn -cryptography==42.0.5 +cryptography==42.0.7 # via http-ece # via py-vapid # via pywebpush distlib==0.3.8 # via virtualenv dj-database-url==2.1.0 -django==4.2.11 +django==4.2.13 # via dj-database-url # via django-cors-headers # via django-debug-toolbar @@ -61,19 +61,19 @@ django-cache-url==3.4.5 django-cors-headers==4.3.1 django-debug-toolbar==4.3.0 django-htmx==1.17.3 -django-storages==1.14.2 +django-storages==1.14.3 dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via pydantic -filelock==3.13.4 +filelock==3.14.0 # via virtualenv -frozendict==2.4.2 +frozendict==2.4.4 # via pyld frozenlist==1.4.1 # via aiohttp # via aiosignal -google-api-core==2.18.0 +google-api-core==2.19.0 # via google-cloud-core # via google-cloud-storage google-auth==2.29.0 @@ -141,8 +141,8 @@ protobuf==4.25.3 # via google-api-core # via googleapis-common-protos # via proto-plus -psycopg==3.1.18 -psycopg-binary==3.1.18 +psycopg==3.1.19 +psycopg-binary==3.1.19 # via psycopg py-vapid==1.9.0 # via pywebpush @@ -161,7 +161,7 @@ pydantic-core==2.18.2 pydantic-settings==2.2.1 pyld==2.0.4 pymemcache==4.0.0 -pytest==8.1.1 +pytest==8.2.0 # via pytest-asyncio # via pytest-django # via pytest-dotenv @@ -187,7 +187,7 @@ rsa==4.9 # via google-auth s3transfer==0.10.1 # via boto3 -sentry-sdk==1.45.0 +sentry-sdk==2.1.1 setuptools==69.5.1 # via nodeenv six==1.16.0 @@ -211,7 +211,7 @@ urllib3==2.2.1 # via sentry-sdk urlman==2.0.1 uvicorn==0.29.0 -virtualenv==20.26.0 +virtualenv==20.26.1 # via pre-commit whitenoise==6.6.0 yarl==1.9.4 diff --git a/requirements.lock b/requirements.lock index 831f46b1..706a2bb5 100644 --- a/requirements.lock +++ b/requirements.lock @@ -22,9 +22,9 @@ asgiref==3.8.1 attrs==23.2.0 # via aiohttp blurhash-python==1.2.2 -boto3==1.34.91 +boto3==1.34.102 # via django-storages -botocore==1.34.91 +botocore==1.34.102 # via boto3 # via s3transfer cachetools==5.3.3 @@ -42,12 +42,12 @@ charset-normalizer==3.3.2 # via requests click==8.1.7 # via uvicorn -cryptography==42.0.5 +cryptography==42.0.7 # via http-ece # via py-vapid # via pywebpush dj-database-url==2.1.0 -django==4.2.11 +django==4.2.13 # via dj-database-url # via django-cors-headers # via django-debug-toolbar @@ -57,17 +57,17 @@ django-cache-url==3.4.5 django-cors-headers==4.3.1 django-debug-toolbar==4.3.0 django-htmx==1.17.3 -django-storages==1.14.2 +django-storages==1.14.3 dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via pydantic -frozendict==2.4.2 +frozendict==2.4.4 # via pyld frozenlist==1.4.1 # via aiohttp # via aiosignal -google-api-core==2.18.0 +google-api-core==2.19.0 # via google-cloud-core # via google-cloud-storage google-auth==2.29.0 @@ -121,8 +121,8 @@ protobuf==4.25.3 # via google-api-core # via googleapis-common-protos # via proto-plus -psycopg==3.1.18 -psycopg-binary==3.1.18 +psycopg==3.1.19 +psycopg-binary==3.1.19 # via psycopg py-vapid==1.9.0 # via pywebpush @@ -155,7 +155,7 @@ rsa==4.9 # via google-auth s3transfer==0.10.1 # via boto3 -sentry-sdk==1.45.0 +sentry-sdk==2.1.1 six==1.16.0 # via blurhash-python # via python-dateutil diff --git a/users/models/identity.py b/users/models/identity.py index 1b78d866..39439021 100644 --- a/users/models/identity.py +++ b/users/models/identity.py @@ -52,7 +52,7 @@ class IdentityStates(StateGraph): """ outdated = State(try_interval=3600, force_initial=True) - updated = State(try_interval=86400 * 15, attempt_immediately=False) + updated = State(try_interval=86400 * 7, attempt_immediately=False) edited = State(try_interval=300, attempt_immediately=True) deleted = State(try_interval=300, attempt_immediately=True) diff --git a/users/services/identity.py b/users/services/identity.py index c8eeb594..1011b471 100644 --- a/users/services/identity.py +++ b/users/services/identity.py @@ -413,12 +413,16 @@ def handle_internal_sync_actor(cls, payload): # Do all the fetching in threads using a single client for fn, url, action in pipeline: if url: - future_actions[pool.submit(fn, client, url)] = action + future_actions[pool.submit(fn, client, url)] = (action, url) # Re-submit the updates to happen in threads as well for f in concurrent.futures.as_completed(future_actions): - pool.submit(future_actions[f], f.result()) + action, url = future_actions[f] + try: + pool.submit(action, f.result()) + except ValueError: + logger.exception("Error fetching %s", url) # Wait for everything to finish pool.shutdown() - logger.info("SYNC %s", stats) + logger.info("SYNC %s: %s", actor.actor_uri, stats) actor.stats = stats actor.save(update_fields=["stats"])