MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / put

Method put

ui/easydiffusion/task_manager.py:131–142  ·  view source on GitHub ↗
(self, key: Hashable, value: Any, ttl: int)

Source from the content-addressed store, hash-verified

129 self._lock.release()
130
131 def put(self, key: Hashable, value: Any, ttl: int) -> bool:
132 if not self._lock.acquire(blocking=True, timeout=LOCK_TIMEOUT):
133 raise Exception("DataCache.put" + ERR_LOCK_FAILED)
134 try:
135 self._base[key] = (self._get_ttl_time(ttl), value)
136 except Exception:
137 log.error(traceback.format_exc())
138 return False
139 else:
140 return True
141 finally:
142 self._lock.release()
143
144 def tryGet(self, key: Hashable) -> Any:
145 if not self._lock.acquire(blocking=True, timeout=LOCK_TIMEOUT):

Callers 8

setStorageDataFunction · 0.45
putMethod · 0.45
thread_renderFunction · 0.45
get_cached_sessionFunction · 0.45
enqueue_taskFunction · 0.45
make_imagesFunction · 0.45
on_image_stepFunction · 0.45
runMethod · 0.45

Calls 1

_get_ttl_timeMethod · 0.95

Tested by

no test coverage detected