Conversation
…/python-sdk into mpirnovar/odp_segment_manager
|
@jaeopt Fixed your comments. Note that I will need to wait for Andy to merge OdpEventManager and then I will add couple of things to this PR -> refactor some tests and updated odp event. You can have another look now if you like, but I will ask to review again after I'm done with that change. |
|
@andrewleap-optimizely Got your changes in as well. Feel free to give feedback or wait until I make final changes to a few tests and odp event after the OdpEventManager merge. |
The suggested test changes blocked by |
andrewleap-optimizely
left a comment
There was a problem hiding this comment.
Looks really good! Just a couple little things
andrewleap-optimizely
left a comment
There was a problem hiding this comment.
Just a few more minor suggestions
| self.logger.debug('ODP cache hit. Returning segments from cache.') | ||
| return segments | ||
|
|
||
| self.logger.debug('ODP cache miss. Making a call to ODP server.') |
There was a problem hiding this comment.
This is not necessarily a cache miss... We might want to split this into two debug logs
There was a problem hiding this comment.
@andrewleap-optimizely Not sure what you mean, can you clarify? If we don't hit the cache we miss it no?
U mean if we don't hit the cache there is the third option that is not a cache miss?
Rb segment manager has the same btw
There was a problem hiding this comment.
I mean that the cache might not have been checked, because ignore_cache was set.
Yea I should change it in ruby and probably Java where I pulled it from 😀
There was a problem hiding this comment.
Something like this:
if not ignore_cache and not reset_cache:
segments = self.segments_cache.lookup(cache_key)
if segments:
self.logger.debug('ODP cache hit. Returning segments from cache.')
return segments
self.logger.debug('ODP cache miss.')
self.logger.debug('Making a call to ODP server.')Otherwise looking at the logs with a disabled cache may confuse the reader into thinking the cache is being used.
There was a problem hiding this comment.
I see, yeah, that makes total sense. good catch
jaeopt
left a comment
There was a problem hiding this comment.
LGTM with a nit. Can you remove "WIP" from the PR title?
Summary
Test plan
Issues