Merge pull request #3842 from Gallaecio/documentation-coverage

Document scrapy.crawler.Crawler.stop()
This commit is contained in:
Mikhail Korobov 2019-06-25 22:28:55 +03:00 committed by GitHub
commit bc137dd215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -99,6 +99,8 @@ how you :ref:`configure the downloader middlewares
Returns a deferred that is fired when the crawl is finished.
.. automethod:: stop
.. autoclass:: CrawlerRunner
:members:

View File

@ -111,6 +111,8 @@ class Crawler(object):
@defer.inlineCallbacks
def stop(self):
"""Starts a graceful stop of the crawler and returns a deferred that is
fired when the crawler is stopped."""
if self.crawling:
self.crawling = False
yield defer.maybeDeferred(self.engine.stop)