forked from 00dani/lemoncurry
Actually queue up the ping_hub operation on the queue by using its delay() method
This commit is contained in:
parent
e853e22362
commit
45298abb98
2 changed files with 7 additions and 4 deletions
|
@ -1,8 +1,11 @@
|
|||
from django_push import publisher
|
||||
import requests
|
||||
from django.conf import settings
|
||||
from django_rq import job
|
||||
|
||||
|
||||
@job
|
||||
def ping_hub(*urls):
|
||||
for url in urls:
|
||||
publisher.ping_hub(url)
|
||||
requests.post(settings.PUSH_HUB, data={
|
||||
'hub.mode': 'publish',
|
||||
'hub.url': ','.join(urls),
|
||||
})
|
||||
|
|
|
@ -43,7 +43,7 @@ def micropub(request):
|
|||
reverse('entries:atom'),
|
||||
reverse('entries:rss'),
|
||||
))
|
||||
ping_hub(perma, *others)
|
||||
ping_hub.delay(perma, *others)
|
||||
|
||||
res = HttpResponse(status=201)
|
||||
res['Location'] = perma
|
||||
|
|
Loading…
Reference in a new issue