Skip to content
Snippets Groups Projects
Commit 26156e80 authored by Oleg Grenrus's avatar Oleg Grenrus
Browse files

Truncate jobs on osx

parent 4fbfda3c
No related branches found
No related tags found
No related merge requests found
......@@ -6,12 +6,28 @@ CABAL_VERSION="1.25.0.0"
# Timing / diagnostic output
# ---------------------------------------------------------------------
JOB_START_TIME=$(date +%s)
timed() {
echo "\$ $*"
start_time=$(date +%s)
# Run the job
$* || exit $?
# Calculate the durations
end_time=$(date +%s)
duration=$((end_time - start_time))
total_duration=$((end_time - JOB_START_TIME))
# Print them
echo "$* took $duration seconds."
echo "whole job took $total_duration seconds so far."
# Terminate on OSX
if [ $total_duration -ge 2400 -a $(uname) = "Darwin" ]; then
echo "Job taking over 40 minutes. Terminating"
exit 1
fi
echo "----"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment