Skip to content

Commit

Permalink
Merge pull request #860 from scrapinghub/develop
Browse files Browse the repository at this point in the history
Support start urls in get key for cache
  • Loading branch information
ruairif authored Jun 4, 2018
2 parents 661f526 + 60c6a56 commit 24bdb44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions portia_server/portia_orm/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ def get_key(model):
return get_key(model)
elif isinstance(model, str):
return (self.__class__, model)
try:
return ('start-url', (model['type'], model['url']))
except (TypeError, KeyError):
pass
raise TypeError('invalid key: {!r}'.format(model))
self.cache = OrderedIndexedTransformDict(get_key)
self.owner = owner and owner.with_snapshots()
Expand Down

0 comments on commit 24bdb44

Please sign in to comment.