This commit is contained in:
olli 2024-03-25 21:50:01 +01:00
parent f3c1fa5a0b
commit f24d18ca23

View File

@ -2,8 +2,13 @@ function g_python {
unset g_python_result
g_rnd=$$
local g_python_jobs
mapfile -t g_python_jobs < <(jobs -r)
# Use python in backround for multiple python commands running much faster
if [ -z "${g_python_running}" ]
#if [ -z "${g_python_running}" ]
if ! [[ ${g_python_jobs[*]} =~ python-pipeexec.py ]]
then
mkdir -p ${g_tmp}/${g_rnd}
[ -p ${g_tmp}/${g_rnd}/python-in ] || mkfifo ${g_tmp}/${g_rnd}/python-in
@ -21,7 +26,6 @@ function g_python {
echo "$@" >${g_tmp}/${g_rnd}/python-in &
sleep 0.02
local g_python_jobs
mapfile -t g_python_jobs < <(jobs -r)
if ! [[ ${g_python_jobs[*]} =~ python-pipeexec.py ]]
then