Showing 1 of 1 files from the diff.

@@ -319,18 +319,26 @@
Loading
319 319
        # Use `largs=log_args` to copy log_args into function's scope
320 320
        # instead of using `log_args` from the outer scope
321 321
        d.addCallback(
322 -
            lambda _, largs=log_args: logger.info(
323 -
                logfmt % "Stored", largs, extra={'spider': spider}
324 -
            )
322 +
            self._handle_store_success, log_args, logfmt, spider, type(slot.storage).__name__
325 323
        )
326 324
        d.addErrback(
327 -
            lambda f, largs=log_args: logger.error(
328 -
                logfmt % "Error storing", largs,
329 -
                exc_info=failure_to_exc_info(f), extra={'spider': spider}
330 -
            )
325 +
            self._handle_store_error, log_args, logfmt, spider, type(slot.storage).__name__
331 326
        )
332 327
        return d
333 328
329 +
    def _handle_store_error(self, f, largs, logfmt, spider, slot_type):
330 +
        logger.error(
331 +
            logfmt % "Error storing", largs,
332 +
            exc_info=failure_to_exc_info(f), extra={'spider': spider}
333 +
        )
334 +
        self.crawler.stats.inc_value(f"feedexport/failed_count/{slot_type}")
335 +
336 +
    def _handle_store_success(self, f, largs, logfmt, spider, slot_type):
337 +
        logger.info(
338 +
            logfmt % "Stored", largs, extra={'spider': spider}
339 +
        )
340 +
        self.crawler.stats.inc_value(f"feedexport/success_count/{slot_type}")
341 +
334 342
    def _start_new_batch(self, batch_id, uri, feed_options, spider, uri_template):
335 343
        """
336 344
        Redirect the output data stream to a new file.
Files Coverage
scrapy 87.87%
Project Totals (160 files) 87.87%
9737.7
TRAVIS_PYTHON_VERSION=3.6.1
TRAVIS_OS_NAME=linux
TOXENV=asyncio-pinned
9737.6
TRAVIS_PYTHON_VERSION=3.6.1
TRAVIS_OS_NAME=linux
TOXENV=pinned
9737.11
TRAVIS_PYTHON_VERSION=3.7
TRAVIS_OS_NAME=linux
TOXENV=py
9737.9
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
TOXENV=py
9737.13
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
TOXENV=extra-deps
9737.12
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
TOXENV=py
9737.14
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
TOXENV=asyncio
1
comment:
2
  layout: "header, diff, tree"
3

4
coverage:
5
  status:
6
    project: false
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading