MCPcopy Create free account
hub / github.com/tiny-pilot/tinypilot / get

Function get

app/update/status.py:17–35  ·  view source on GitHub ↗

Retrieves the current state of the update process. Checks the state of any actively running update jobs or jobs that have finished in the last 30 minutes and returns the status and error state. Returns: A two-tuple where the first value is a Status enum and the second is a

()

Source from the content-addressed store, hash-verified

15
16
17def get():
18 """Retrieves the current state of the update process.
19
20 Checks the state of any actively running update jobs or jobs that have
21 finished in the last 30 minutes and returns the status and error state.
22
23 Returns:
24 A two-tuple where the first value is a Status enum and the second is a
25 string containing the error associated with a recently completed update
26 job. If the job completed successfully, the second value is None.
27 """
28 if _is_update_process_running():
29 return Status.IN_PROGRESS, None
30
31 recent_result = update.result_store.read()
32 if not recent_result:
33 return Status.NOT_RUNNING, None
34
35 return Status.DONE, recent_result.error
36
37
38def _is_update_process_running():

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected