add timeout handler
Browse files
__pycache__/prefect_utils.cpython-311.pyc
CHANGED
|
Binary files a/__pycache__/prefect_utils.cpython-311.pyc and b/__pycache__/prefect_utils.cpython-311.pyc differ
|
|
|
maintenance_flow.py
CHANGED
|
@@ -32,8 +32,14 @@ def request_wells_maintenance(maintenance_type):
|
|
| 32 |
user_input = pause_flow_run(
|
| 33 |
wait_for_input=UserInput.with_initial_data(
|
| 34 |
description=description
|
| 35 |
-
),
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
set_maintenance_status(maintenance_type,0)
|
| 39 |
|
|
|
|
| 32 |
user_input = pause_flow_run(
|
| 33 |
wait_for_input=UserInput.with_initial_data(
|
| 34 |
description=description
|
| 35 |
+
),
|
| 36 |
+
timeout = 3000 #Should we have a timeout, or just let it waits until maintenance complete?
|
| 37 |
+
)
|
| 38 |
+
#Same as above, and even without this timeout handler, following database update codes will not run
|
| 39 |
+
if not user_input:
|
| 40 |
+
logger.warning("[DEBUG]Flow resumed automatically due to timeout.")
|
| 41 |
+
return "Maintenance flow timed out with no user interaction. " \
|
| 42 |
+
"The requested maintenance was not carried out."
|
| 43 |
|
| 44 |
set_maintenance_status(maintenance_type,0)
|
| 45 |
|