tasks & workers: use NULL in reads from db
This commit is contained in:
parent
c5815669e2
commit
0cf8ee09b4
@ -10,7 +10,7 @@ gettaskinfos() {
|
|||||||
FROM tasks
|
FROM tasks
|
||||||
WHERE id='$1';
|
WHERE id='$1';
|
||||||
' >&3
|
' >&3
|
||||||
read -u4 line
|
read -u4 -d$'\0' line
|
||||||
taskid=${line%%::AtOM:SQL:Sep::*}
|
taskid=${line%%::AtOM:SQL:Sep::*}
|
||||||
rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::"
|
rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::"
|
||||||
sourcefileid=${rest%%::AtOM:SQL:Sep::*}
|
sourcefileid=${rest%%::AtOM:SQL:Sep::*}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
createworker() {
|
createworker() {
|
||||||
(( ++active ))
|
(( ++active ))
|
||||||
read -u4 line
|
read -u4 -d$'\0' line
|
||||||
taskid=${line%%::AtOM:SQL:Sep::*}
|
taskid=${line%%::AtOM:SQL:Sep::*}
|
||||||
rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::"
|
rest="${line#*::AtOM:SQL:Sep::}::AtOM:SQL:Sep::"
|
||||||
sourcefileid=${rest%%::AtOM:SQL:Sep::*}
|
sourcefileid=${rest%%::AtOM:SQL:Sep::*}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ master() {
|
|||||||
WHERE status = 0;
|
WHERE status = 0;
|
||||||
'>&3
|
'>&3
|
||||||
|
|
||||||
read -u4 remaining
|
read -u4 -d$'\0' remaining
|
||||||
if (( remaining == 0 ))
|
if (( remaining == 0 ))
|
||||||
then
|
then
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
@ -108,7 +108,7 @@ master() {
|
|||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
'>&3
|
'>&3
|
||||||
|
|
||||||
read -u4 ready
|
read -u4 -d$'\0' ready
|
||||||
if (( ready > 0 ))
|
if (( ready > 0 ))
|
||||||
then
|
then
|
||||||
createworker
|
createworker
|
||||||
@ -194,7 +194,7 @@ master() {
|
|||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
' >&3
|
' >&3
|
||||||
|
|
||||||
read -u4 ready
|
read -u4 -d$'\0' ready
|
||||||
|
|
||||||
if (( active == 0 && ready == 0 ))
|
if (( active == 0 && ready == 0 ))
|
||||||
then
|
then
|
||||||
@ -234,7 +234,7 @@ master() {
|
|||||||
WHERE status = 0;
|
WHERE status = 0;
|
||||||
'>&3
|
'>&3
|
||||||
|
|
||||||
read -u4 remaining
|
read -u4 -d$'\0' remaining
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user