From 4c8232a28452a49eebbeb8fea6891dfb0f4039d5 Mon Sep 17 00:00:00 2001
From: Brett Smith <brett@sfconservancy.org>
Date: Fri, 10 Nov 2017 11:45:58 -0500
Subject: [PATCH] website-update: Make sqlite loading more robust.

* Bail on the first error.
* Allow 30 seconds to open a locked table.
---
 cron/scripts/website-update.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cron/scripts/website-update.sh b/cron/scripts/website-update.sh
index 875597de..b3b5c9fa 100755
--- a/cron/scripts/website-update.sh
+++ b/cron/scripts/website-update.sh
@@ -21,7 +21,7 @@ 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,