From 2b300750b381547a3fd938535a2801f6f0a5fe4f Mon Sep 17 00:00:00 2001 From: Brian Flowers Date: Tue, 20 Sep 2016 03:21:37 -0400 Subject: [PATCH] Attempting to fix sqlite3 processor commit delay --- bdsm.d/sqlite3.processor | 2 +- bdsm.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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() -- 1.8.3.1