MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / run

Method run

misc/python/materialize/parallel_task.py:66–86  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

64 self._command = resolved
65
66 def run(self) -> None:
67 start = datetime.now()
68 try:
69 if self._fn is not None:
70 self.success, self.output = self._fn()
71 else:
72 assert self._command is not None
73 proc = subprocess.Popen(
74 self._command,
75 stdout=subprocess.PIPE,
76 stderr=subprocess.STDOUT,
77 )
78 stdout, _ = proc.communicate()
79 self.success = proc.returncode == 0
80 self.output = stdout.decode("utf-8").strip()
81 except Exception as e:
82 self.output = str(e)
83 self.success = False
84 self.duration = datetime.now() - start
85 if self._done_queue is not None:
86 self._done_queue.put(self)
87
88
89class _SpinnerThread(threading.Thread):

Callers

nothing calls this directly

Calls 3

putMethod · 0.80
nowMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected