MCPcopy Create free account
hub / github.com/diffgram/diffgram / get_input_with_retry

Method get_input_with_retry

walrus/methods/input/process_media.py:200–218  ·  view source on GitHub ↗

(self)

Source from the content-addressed store, hash-verified

198 @retry(wait = wait_random_exponential(multiplier = .5, max = 120),
199 stop = stop_after_attempt(30))
200 def get_input_with_retry(self):
201 """
202 """
203
204 if self.input:
205 return
206
207 try:
208 logger.info(f"Getting input {self.input_id}")
209 self.input = Input.get_by_id(
210 session = self.session,
211 id = self.input_id)
212
213 if self.input is None:
214 raise Exception
215
216 except Exception as e:
217 logger.warn(f"Unable to fetch input ID: {self.input_id}")
218 self.attempt_reinsert_input()
219
220
221 @retry(wait = wait_random_exponential(multiplier = 2, max = 1024),

Callers 1

main_entryMethod · 0.95

Calls 2

get_by_idMethod · 0.45

Tested by

no test coverage detected