From: Brian Flowers Date: Tue, 20 Sep 2016 07:21:37 +0000 (-0400) Subject: Attempting to fix sqlite3 processor commit delay X-Git-Url: http://git.slightlycyberpunk.com%2C%20git.slightlycyberpunk.com/git/?a=commitdiff_plain;h=2b300750b381547a3fd938535a2801f6f0a5fe4f;p=bdsm.git Attempting to fix sqlite3 processor commit delay --- diff --git a/bdsm.d/sqlite3.processor b/bdsm.d/sqlite3.processor index 076b0f4..63b9af6 100644 --- a/bdsm.d/sqlite3.processor +++ b/bdsm.d/sqlite3.processor @@ -54,7 +54,7 @@ start() cat /home/bdsm/in.fifo | awk -F'|' '{ \ printf("INSERT INTO MEASUREMENTS(timestamp,host,attribute,value) \ - VALUES (%s,\"%s\", \"%s\", \"%s\");\n",$1,$2, $3, $4) }' | \ + VALUES (%s,\"%s\", \"%s\", \"%s\"); COMMIT;\n",$1,$2, $3, $4) }' | \ sqlite3 bdsm.sqlite3 & echo $! > /home/bdsm/.processor.pid } diff --git a/bdsm.sh b/bdsm.sh index 3239aaa..85f4309 100755 --- a/bdsm.sh +++ b/bdsm.sh @@ -43,6 +43,16 @@ failure() exit 255 } + +# VARIABLES +############################################################################### + +if [ -f "/home/bdsm/bdsm.d/$1.processor" ]; then + processor="${1}" +else + processor="" +fi + # UTILITY FUNCTIONS ############################################################################### error()