Skip to content

Commit 7d64bc6

Browse files
committed
fixed bug in feature store update; added debug logging
1 parent 52b868c commit 7d64bc6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

ldclient/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def upsert(self, key, feature):
130130
self._lock.lock()
131131
f = self._features.get(key)
132132
if f is None or f['version'] < feature['version']:
133-
self._features[key] = f
133+
self._features[key] = feature
134+
log.debug("Updated feature {} to version {}".format(key, feature['version']))
134135
finally:
135136
self._lock.unlock()
136137

ldclient/requests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,13 @@ def stop(self):
8080
@staticmethod
8181
def process_message(store, msg):
8282
payload = json.loads(msg.data)
83+
log.debug("Recieved stream event {}".format(msg.event))
8384
if msg.event == 'put':
8485
store.init(payload)
8586
elif msg.event == 'patch':
8687
key = payload['path'][1:]
8788
feature = payload['data']
89+
log.debug("Updating feature {}".format(key))
8890
store.upsert(key, feature)
8991
elif msg.event == 'delete':
9092
key = payload['path'][1:]

0 commit comments

Comments
 (0)