tasks & workers: use NULL in reads from db
This commit is contained in:
parent
c5815669e2
commit
0cf8ee09b4
@ -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::*}
|
||||
|
||||
@ -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::*}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user