Updating sqlite3 processor to set journal_mode=wal to try to improve performance...
authorBrian Flowers <git-admn@bsflowers.net>
Fri, 4 Nov 2016 20:55:55 +0000 (16:55 -0400)
committerBrian Flowers <git-admn@bsflowers.net>
Fri, 4 Nov 2016 20:55:55 +0000 (16:55 -0400)
etc/bdsm/processors/sqlite3.processor

index 2b55f8d..557e241 100755 (executable)
@@ -41,6 +41,11 @@ help()
 
 start()
 {
+  journal_mode="`sqlite3 $CONFIG_PATH/bdsm.db 'PRAGMA journal_mode;'`"
+  if [ "$journal_mode" != "wal" ]; then
+    sqlite3 $CONFIG_PATH/bdsm.db "PRAGMA journal_mode;"
+  fi
+  
   sqlite3 $CONFIG_PATH/bdsm.db "SELECT 1 FROM MEASUREMENTS" 2>/dev/null 1>&2
   if [ $? -eq 1 ]; then
     sqlite3 $CONFIG_PATH/bdsm.db \
@@ -67,7 +72,7 @@ stop()
 
 status()
 {
-  running=`cat /home/bdsm/.processor.pid 2>/dev/null | \
+  running=`cat /home/bdsm/pids/sqlite3.processor.pid 2>/dev/null | \
                             xargs ps -T | \
                             grep -v PID | \
                             wc -l`