mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 10:37:13 +02:00
Add "reset" support for "memoized"
This commit is contained in:
@ -138,8 +138,12 @@ class memoized(object):
|
|||||||
self.cache[key] = (time.time(), func(*args, **kwargs))
|
self.cache[key] = (time.time(), func(*args, **kwargs))
|
||||||
return self.cache[key][1]
|
return self.cache[key][1]
|
||||||
|
|
||||||
|
wrapper.reset = self._reset
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
def _reset(self):
|
||||||
|
self.cache = {}
|
||||||
|
|
||||||
|
|
||||||
class throttle(object):
|
class throttle(object):
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user