Changeset - 4c8232a28452
[Not reviewed]
0 1 0
Brett Smith (brett) - 4 years ago 2017-11-10 16:45:58
brett@sfconservancy.org
website-update: Make sqlite loading more robust.

* Bail on the first error.
* Allow 30 seconds to open a locked table.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
cron/scripts/website-update.sh
Show inline comments
...
 
@@ -18,13 +18,13 @@ if ! mkdir "$LOCKDIR"; then
 
    exit $?
 
fi
 
trap 'rmdir "$LOCKDIR"' 0 INT TERM QUIT
 

	
 
exitcode=0
 
if [ "$DB_SCRIPT" -nt "$DB_FILE" ]; then
 
    sqlite3 "$DB_FILE" <"$DB_SCRIPT" || exitcode=$?
 
    sqlite3 -bail -cmd ".timeout 30000" "$DB_FILE" <"$DB_SCRIPT" || exitcode=$?
 
fi
 

	
 
# If the checkout is not on the production branch,
 
# assume maintenance is happening and stop.
 
cd "$SITEDIR"
 
if [ "$(git_rev_name HEAD)" != "$PRODUCTION_BRANCH" ]; then
0 comments (0 inline, 0 general)