From: Sebastian Brix Date: Thu, 19 Jul 2018 11:48:36 +0000 (+0200) Subject: - fix: initialize missing cache with empty tuple and not with empty list X-Git-Tag: 0.1.0-alpha.2 X-Git-Url: http://git.graph-it.com/?a=commitdiff_plain;ds=sidebyside;p=screwerk%2Fsupcon.git - fix: initialize missing cache with empty tuple and not with empty list - fix: provide valid callback to update() --- diff --git a/supcon/cache.py b/supcon/cache.py index d97a757..0f8169f 100644 --- a/supcon/cache.py +++ b/supcon/cache.py @@ -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']: