From 0cf8ee09b4870c8e716684270e76c9cdd340e699 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Mon, 10 Nov 2025 15:36:26 +0100 Subject: [PATCH] tasks & workers: use NULL in reads from db --- lib/tasks/gettaskinfos | 2 +- lib/workers/create | 2 +- lib/workers/master | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/tasks/gettaskinfos b/lib/tasks/gettaskinfos index 648e4ab..7604735 100644 --- a/lib/tasks/gettaskinfos +++ b/lib/tasks/gettaskinfos @@ -10,7 +10,7 @@ gettaskinfos() { FROM tasks WHERE id='$1'; ' >&3 - read -u4 line + read -u4 -d$'\0' line taskid=${line%%::AtOM:SQL:Sep::*} rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::" sourcefileid=${rest%%::AtOM:SQL:Sep::*} diff --git a/lib/workers/create b/lib/workers/create index f4c9cff..02f69fb 100644 --- a/lib/workers/create +++ b/lib/workers/create @@ -2,7 +2,7 @@ createworker() { (( ++active )) - read -u4 line + read -u4 -d$'\0' line taskid=${line%%::AtOM:SQL:Sep::*} rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::" sourcefileid=${rest%%::AtOM:SQL:Sep::*} diff --git a/lib/workers/master b/lib/workers/master index 0ef64e8..c88a9d8 100644 --- a/lib/workers/master +++ b/lib/workers/master @@ -10,7 +10,7 @@ master() { WHERE status = 0; '>&3 - read -u4 remaining + read -u4 -d$'\0' remaining if (( remaining == 0 )) then sleep 0.1 @@ -108,7 +108,7 @@ master() { LIMIT 1; '>&3 - read -u4 ready + read -u4 -d$'\0' ready if (( ready > 0 )) then createworker @@ -194,7 +194,7 @@ master() { LIMIT 1; ' >&3 - read -u4 ready + read -u4 -d$'\0' ready if (( active == 0 && ready == 0 )) then @@ -234,7 +234,7 @@ master() { WHERE status = 0; '>&3 - read -u4 remaining + read -u4 -d$'\0' remaining done fi }