- fix: initialize missing cache with empty tuple and not with empty list master 0.1.0-alpha.2
authorSebastian Brix <sebastian.brix@graph-it.com>
Thu, 19 Jul 2018 11:48:36 +0000 (13:48 +0200)
committerSebastian Brix <sebastian.brix@graph-it.com>
Thu, 19 Jul 2018 11:48:36 +0000 (13:48 +0200)
- fix: provide valid callback to update()

supcon/cache.py

index d97a757a8e0e0db86a1e7042b62864a9a7a02191..0f8169f65e5eb648b786142103b3f48413d0b2fa 100644 (file)
@@ -44,7 +44,7 @@ class LocalEventCache(supcon.intf.Implementation):
     supcon.intf.Implementation.__init__(self, EventCacheIntf)
 
     self.__local = local
-    self.__store = store([])
+    self.__store = store(())
     self.__maxEvents = maxEvents
 
     self.__watches = {}
@@ -170,7 +170,7 @@ class RemoteEventCache(supcon.util.EventEmitterMixin):
 
     if outArgs['first'] > self.__store.value:
       amount = outArgs['first'] - self.__store.value
-      self.__store.update((outArgs['first']).__add__(0))
+      self.__store.update(lambda v: outArgs['first'])
       self._emit('missing', amount=amount)
 
     for number, path, intf, event, args in outArgs['events']: