2017-11-05 19:46:43 -05:00
|
|
|
import requests
|
|
|
|
from django.conf import settings
|
2017-11-05 19:04:22 -05:00
|
|
|
from django_rq import job
|
2017-11-05 19:49:43 -05:00
|
|
|
from urllib.parse import urlencode
|
2017-11-05 19:04:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
@job
|
|
|
|
def ping_hub(*urls):
|
2017-11-05 19:46:43 -05:00
|
|
|
requests.post(settings.PUSH_HUB, data={
|
|
|
|
'hub.mode': 'publish',
|
2017-11-05 19:49:43 -05:00
|
|
|
'hub.url': ','.join(map(urlencode, urls)),
|
2017-11-05 19:46:43 -05:00
|
|
|
})
|