diff --git a/utils/stuck-write.sh b/utils/stuck-write.sh index 2909f7e..f21576d 100755 --- a/utils/stuck-write.sh +++ b/utils/stuck-write.sh @@ -1,16 +1,16 @@ #!/bin/bash function req { ssh c4science-db01 "mysql -B -e \"$@\" phabricator_repository" 2> /dev/null } repo=$(req 'select w.writeProperties,r.phid,a.name from repository_workingcopyversion as w,repository as r, phabricator_almanac.almanac_device as a where a.phid=w.devicePHID and r.phid=w.repositoryPHID and w.isWriting=1;' | tail -n +2) if [ -z "$repo" ]; then echo "Nothing to do.. exiting"; exit; fi while read -r r; do TS=$(echo "$r" | cut -f1 | jq -r '.epoch') - if [ $TS -lt $(($(date +%s)-3600)) ]; then # older than 1 hour + if [ $TS -lt $(($(date +%s)-300)) ]; then # older than 5 minutes echo "$r" | cut -f2,3 fi done <<< "$repo"