Page MenuHomec4science

stuck-write.sh
No OneTemporary

File Metadata

Created
Fri, May 10, 17:51

stuck-write.sh

#!/bin/bash
function req {
ssh c4science-db01 "mysql -B -e \"$@\" phabricator_repository" 2> /dev/null
}
repo=$(req 'select w.writeProperties,r.phid from repository_workingcopyversion as w,repository as r where 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
echo "$r" | cut -f2
fi
done <<< "$repo"

Event Timeline