Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (9 sloc) 349 Bytes
from twisted.internet import reactor
from twisted.internet.defer import Deferred
class DelayedRequestsMiddleware(object):
def process_request(self, request, spider):
delay = request.meta.get('delay_request', None)
if delay:
d = Deferred()
reactor.callLater(delay, d.callback, None)
return d
You can’t perform that action at this time.