revert: "perf: decrease scheduler checks from every 1 second to 10 seconds (#409)"

This reverts commit 4938e84827.
This commit is contained in:
Vladislav Doster 2022-11-20 03:46:39 -06:00
parent 9e6f835b73
commit 0c1839a18b

View file

@ -2390,14 +2390,10 @@ $match[7]}:-${ZINIT[__last-formatter-code]}}}:+}}}//←→}
# (delay), i.e. "burst" allows to run package installations from
# script, not from prompt.
@zinit-scheduler() {
integer ___ret="${${ZINIT[lro-data]%:*}##*:}" ___secs=$(($#ZINIT_TASKS>1?1:10))
___secs=$(($#ZINIT_TASKS>1?1:10))
integer ___ret="${${ZINIT[lro-data]%:*}##*:}"
# lro stands for lastarg-retval-option.
[[ $1 = following ]] && \
sched +$___secs 'ZINIT[lro-data]="$_:$?:${options[printexitvalue]}"; @zinit-scheduler following "${ZINIT[lro-data]%:*:*}"'
(( ___secs == 10 )) && return 0
[[ -n $1 && $1 != (following*|burst) ]] && \
{ local THEFD="$1"; zle -F "$THEFD"; exec {THEFD}<&-; }
[[ $1 = following ]] && sched +1 'ZINIT[lro-data]="$_:$?:${options[printexitvalue]}"; @zinit-scheduler following "${ZINIT[lro-data]%:*:*}"'
[[ -n $1 && $1 != (following*|burst) ]] && { local THEFD="$1"; zle -F "$THEFD"; exec {THEFD}<&-; }
[[ $1 = burst ]] && local -h EPOCHSECONDS=$(( EPOCHSECONDS+10000 ))
ZINIT[START_TIME]="${ZINIT[START_TIME]:-$EPOCHREALTIME}"