bugfix: improve subscription system
This commit is contained in:
parent
efb334ebc4
commit
5352ba938a
@ -51,11 +51,11 @@ def send_notification(sender, instance, **kwargs):
|
|||||||
process = Thread(target=send_request, args=[subscription.inbox, url])
|
process = Thread(target=send_request, args=[subscription.inbox, url])
|
||||||
process.start()
|
process.start()
|
||||||
threads.append(process)
|
threads.append(process)
|
||||||
def send_request(target, object):
|
def send_request(target, objectIri):
|
||||||
try:
|
try:
|
||||||
req=requests.post(target,
|
req=requests.post(target,
|
||||||
json={"@context":"https://cdn.happy-dev.fr/owl/hdcontext.jsonld",
|
json={"@context":"https://cdn.happy-dev.fr/owl/hdcontext.jsonld",
|
||||||
"object": object, "type": "system", "read": False},
|
"object": objectIri, "type": "update"},
|
||||||
headers={"Content-Type": "application/ld+json"})
|
headers={"Content-Type": "application/ld+json"})
|
||||||
except:
|
except:
|
||||||
logging.error('Djangoldp_notifications: Error with request')
|
logging.error('Djangoldp_notifications: Error with request')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user