MCPcopy Index your code
hub / github.com/WebODM/WebODM / callback

Method callback

app/models/task.py:747–755  ·  view source on GitHub ↗
(progress)

Source from the content-addressed store, hash-verified

745 # to every 2 seconds (and always record the 100% progress)
746 last_update = 0
747 def callback(progress):
748 nonlocal last_update
749
750 time_has_elapsed = time.time() - last_update >= 2
751 if time_has_elapsed:
752 testWatch.manual_log_call("Task.process.callback")
753 self.check_if_canceled()
754 Task.objects.filter(pk=self.id).update(upload_progress=float(progress) / 100.0)
755 last_update = time.time()
756
757 # This takes a while
758 try:

Callers 2

Chart.min.jsFile · 0.80
oFunction · 0.80

Calls 3

check_if_canceledMethod · 0.95
manual_log_callMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected