MCPcopy
hub / github.com/pyload/pyload / set_wait

Method set_wait

module/plugins/internal/Base.py:309–328  ·  view source on GitHub ↗

Set a specific wait time later used with `wait` :param seconds: wait time in seconds :param reconnect: True if a reconnect would avoid wait time

(self, seconds, strict=False)

Source from the content-addressed store, hash-verified

307 self.wantReconnect = bool(reconnect)
308
309 def set_wait(self, seconds, strict=False):
310 """
311 Set a specific wait time later used with `wait`
312
313 :param seconds: wait time in seconds
314 :param reconnect: True if a reconnect would avoid wait time
315 """
316 wait_time = float(seconds)
317
318 if wait_time < 0:
319 return False
320
321 old_wait_until = self.pyfile.waitUntil
322 new_wait_until = time.time() + wait_time + float(not strict)
323
324 self.log_debug("WAIT set to timestamp %f" % new_wait_until,
325 "Previous waitUntil: %f" % old_wait_until)
326
327 self.pyfile.waitUntil = new_wait_until
328 return True
329
330 def wait(self, seconds=None, reconnect=None):
331 """

Callers 8

waitMethod · 0.95
_post_parametersMethod · 0.80
handle_freeMethod · 0.80
handle_freeMethod · 0.80
handle_freeMethod · 0.80
handle_freeMethod · 0.80
prepareMethod · 0.80

Calls 1

log_debugMethod · 0.80

Tested by

no test coverage detected