mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
possible causes of celery hangs
This commit is contained in:
parent
8086044b8b
commit
e333193cbc
2 changed files with 7 additions and 2 deletions
|
@ -381,7 +381,7 @@ def shared_inbox():
|
|||
activity_log = ActivityPubLog(direction='in', result='failure')
|
||||
|
||||
try:
|
||||
request_json = request.get_json(force=True)
|
||||
request_json = request.get_json(force=True, cache=False)
|
||||
except werkzeug.exceptions.BadRequest as e:
|
||||
activity_log.exception_message = 'Unable to parse json body: ' + e.description
|
||||
activity_log.result = 'failure'
|
||||
|
|
|
@ -9,6 +9,7 @@ from typing import Union, Tuple, List
|
|||
import redis
|
||||
from flask import current_app, request, g, url_for, json
|
||||
from flask_babel import _
|
||||
from requests import JSONDecodeError
|
||||
from sqlalchemy import text, func, desc
|
||||
from app import db, cache, constants, celery
|
||||
from app.models import User, Post, Community, BannedInstances, File, PostReply, AllowedInstances, Instance, utcnow, \
|
||||
|
@ -341,7 +342,11 @@ def find_actor_or_create(actor: str, create_if_not_found=True, community_only=Fa
|
|||
except requests.exceptions.ConnectionError:
|
||||
return None
|
||||
if actor_data.status_code == 200:
|
||||
actor_json = actor_data.json()
|
||||
try:
|
||||
actor_json = actor_data.json()
|
||||
except JSONDecodeError as e:
|
||||
actor_data.close()
|
||||
return None
|
||||
actor_data.close()
|
||||
actor_model = actor_json_to_model(actor_json, address, server)
|
||||
if community_only and not isinstance(actor_model, Community):
|
||||
|
|
Loading…
Add table
Reference in a new issue