From d95d1da9786a45c632bc5826da7fd5a221cc99ed Mon Sep 17 00:00:00 2001
From: JasperBoom <jboom@infernum.nl>
Date: Tue, 7 Jan 2020 15:50:20 +0100
Subject: [PATCH] Fix SQLite error concerning database/disk space being full.

---
 talon.wdl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/talon.wdl b/talon.wdl
index e2395cb..d63cada 100644
--- a/talon.wdl
+++ b/talon.wdl
@@ -463,7 +463,10 @@ task Talon {
     command <<<
         set -e
         mkdir -p "$(dirname ~{outputPrefix})"
-        export TMPDIR=/tmp
+        mkdir -p $PWD/tmp #Standard /tmp fills up which makes the SQLite process crash.
+        ln -s $PWD/tmp /tmp/sqltmp #Multiprocessing will crash if the absolute path is too long.
+        export TMPDIR=/tmp/sqltmp
+        printf "" > ~{outputPrefix}/talonConfigFile.csv #File needs to be emptied when task is rerun.
         for file in ~{sep=" " SAMfiles}
         do
             configFileLine="$(basename ${file%.*}),~{organism},~{sequencingPlatform},${file}"
-- 
GitLab