mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
config/functions: maybe pedantic, but just in case append isn't thread-safe
This commit is contained in:
parent
956b10dd55
commit
6da44a3931
@ -1261,11 +1261,15 @@ pkg_lock_status() {
|
||||
local status="$1" pkg="$2" task="$3" msg="$4"
|
||||
local this_job="${MTJOBID}" line
|
||||
|
||||
printf -v line "%s: <%05d> [%02d/%0*d] %-7s %-7s %-35s" \
|
||||
"$(date +%Y-%m-%d\ %H:%M:%S.%N)" $$ ${this_job} ${#MTMAXJOBS} ${PARALLEL_SEQ:-0} "${status}" "${task}" "${pkg}"
|
||||
[ -n "${msg}" ] && line+=" (${msg})"
|
||||
(
|
||||
flock --exclusive 94
|
||||
|
||||
echo "${line}" >>"${THREAD_CONTROL}/history"
|
||||
printf -v line "%s: <%05d> [%02d/%0*d] %-7s %-7s %-35s" \
|
||||
"$(date +%Y-%m-%d\ %H:%M:%S.%N)" $$ ${this_job} ${#MTMAXJOBS} ${PARALLEL_SEQ:-0} "${status}" "${task}" "${pkg}"
|
||||
[ -n "${msg}" ] && line+=" (${msg})"
|
||||
|
||||
echo "${line}" >>"${THREAD_CONTROL}/history"
|
||||
) 94>"${THREAD_CONTROL}/locks/.history"
|
||||
|
||||
[ "${DASHBOARD}" != "no" ] && update_dashboard "${status}" "${pkg}" "${task}" "${msg}"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user