Prevent concurrent executions of the feed generator
This commit is contained in:
parent
5c13229bcd
commit
a5d7575384
|
@ -78,6 +78,14 @@ function log {
|
|||
}
|
||||
|
||||
[ -z "$DIR" ] && DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
if [ -e "$DIR/.itsb-feedgen" ]; then
|
||||
echo "The lockfile at $DIR/.itsb-feedgen already exists."
|
||||
exit 1
|
||||
fi
|
||||
log Creating lockfile at "$DIR/.itsb-feedgen"
|
||||
touch "$DIR/.itsb-feedgen"
|
||||
trap "rm -f \"$DIR/.itsb-feedgen\"" EXIT INT TERM
|
||||
|
||||
log Building to $DIR/feeds
|
||||
mkdir -p $DIR/feeds
|
||||
|
||||
|
@ -98,6 +106,8 @@ fi
|
|||
<xsl:text>
|
||||
</xsl:text>
|
||||
<xsl:apply-templates select="//itsb:feed[not(itsb:link)]" />
|
||||
<xsl:text><![CDATA[
|
||||
rm "$DIR/.itsb-feedgen"]]></xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="itsb:feed[not(itsb:link)]">
|
||||
|
|
Loading…
Reference in New Issue