-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix scrapy squeue tests after recent changes to queuelib
- Loading branch information
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9a64d8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I encountered errors with both "FifoDiskQueue
and
FifoSQLiteQueue`.request_to_dict
is not a real serializer because it returns adict
.So a
dict
is pushed into a queue instead of bytes.9a64d8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scrapy can't use FifoDiskQueueu or FifoSQLiteQueue directly, it wraps queuelib queues with a serializer, see https://github.com/scrapy/scrapy/blob/master/scrapy/squeues.py#L31-L34
9a64d8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the settingi s https://github.com/scrapy/scrapy/blob/master/scrapy/settings/default_settings.py#L227
9a64d8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. I completely overlooked this file and set
SCHEDULER_DISK_QUEUE
toFifoSQLiteQueue
directly . Thanks.I manually added the following two lines into squeues.py:
And used
SCHEDULER_DISK_QUEUE = 'scrapy.squeues.PickleFifoSQLiteQueue'
in the settings.py.9a64d8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9a64d8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a better idea. Thanks.