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
|
from django_rq import job
|
||||||
|
|
||||||
|
|
||||||
@job
|
@job
|
||||||
def ping_hub(*urls):
|
def ping_hub(*urls):
|
||||||
for url in urls:
|
requests.post(settings.PUSH_HUB, data={
|
||||||
publisher.ping_hub(url)
|
'hub.mode': 'publish',
|
||||||
|
'hub.url': ','.join(urls),
|
||||||
|
})
|
||||||
|
|
|
@ -43,7 +43,7 @@ def micropub(request):
|
||||||
reverse('entries:atom'),
|
reverse('entries:atom'),
|
||||||
reverse('entries:rss'),
|
reverse('entries:rss'),
|
||||||
))
|
))
|
||||||
ping_hub(perma, *others)
|
ping_hub.delay(perma, *others)
|
||||||
|
|
||||||
res = HttpResponse(status=201)
|
res = HttpResponse(status=201)
|
||||||
res['Location'] = perma
|
res['Location'] = perma
|
||||||
|
|
Loading…
Reference in a new issue