mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-26 13:15:21 -04:00
precommit: Increase timeout for shellcheck to 30s (#4887)
This commit is contained in:
parent
07b1930b13
commit
aaa93fa739
1 changed files with 3 additions and 2 deletions
|
|
@ -45,7 +45,7 @@ def shfmt():
|
|||
# ======================================================================================
|
||||
@app.route("/shellcheck", methods=["POST"])
|
||||
def shellcheck():
|
||||
return run_tool(["shellcheck"], timeout=10)
|
||||
return run_tool(["shellcheck"], timeout=30)
|
||||
|
||||
|
||||
# ======================================================================================
|
||||
|
|
@ -98,8 +98,9 @@ def run_tool(cmd, timeout=3):
|
|||
cmd + [fn], cwd=workdir.name, timeout=timeout, stdout=PIPE, stderr=STDOUT
|
||||
)
|
||||
except subprocess.TimeoutExpired:
|
||||
# Note that GCP Cloud Run returns status 504 when its timeout is reached.
|
||||
app.logger.info(f"Timeout of {cmd[0]} on {data_kb:.1f}KB after {timeout}s.")
|
||||
return f"Timeout while running {cmd[0]} - please try again.", 504
|
||||
return f"Timeout while running {cmd[0]} - please try again.", 408 # Req Timeout
|
||||
t2 = time()
|
||||
app.logger.info(f"Ran {cmd[0]} on {data_kb:.1f}KB in {t2-t1:.1f}s.")
|
||||
if p.returncode != 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue