Scrapy, a fast high-level web crawling & scraping framework for Python.
Set CONCURRENT_SPIDERS=1 in Scrapyd to force one spider per process
Pablo Hoffman65fc2fbd1f0c
diff --git a/scrapyd/environ.py b/scrapyd/environ.pyindex 8b208d76e..1be3db39a 100644--- a/scrapyd/environ.py+++ b/scrapyd/environ.py@@ -30,6 +30,7 @@ class Environment(object):dbpath = os.path.join(self.dbs_dir, '%s.db' % project)env['SCRAPY_SQLITE_DB'] = dbpathenv['SCRAPY_LOG_FILE'] = self._get_log_file(message)+ env['SCRAPY_CONCURRENT_SPIDERS'] = '1' # scrapyd runs one spider per processreturn envdef _get_log_file(self, message):diff --git a/scrapyd/tests/test_environ.py b/scrapyd/tests/test_environ.pyindex e8230a3e9..30605756c 100644--- a/scrapyd/tests/test_environ.py+++ b/scrapyd/tests/test_environ.py@@ -29,6 +29,7 @@ class EnvironmentTest(unittest.TestCase):self.assertEqual(env['SCRAPY_SLOT'], '3')self.assertEqual(env['SCRAPY_SPIDER'], 'myspider')self.assertEqual(env['SCRAPY_JOB'], 'ID')+ self.assertEqual(env['SCRAPY_CONCURRENT_SPIDERS'], '1')self.assert_(env['SCRAPY_SQLITE_DB'].endswith('mybot.db'))self.assert_(env['SCRAPY_LOG_FILE'].endswith('/mybot/myspider/ID.log'))self.failIf('SCRAPY_SETTINGS_MODULE' in env)