File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 2020
2121PYTHON_CMD=" ${PYTHON_CMD:- " python" } "
2222
23+ sleep_until () {
24+ ${PYTHON_CMD} -c " from time import time, sleep; tleft=${SIPLOG_TSTART} + ${1} - time(); sleep(tleft) if tleft > 0 else False;"
25+ }
26+
2327rtpproxy_cmds_gen () {
2428 if [ x" ${RTPP_PRE_STAT_TIMEOUT} " != x" " ]
2529 then
26- sleep ${RTPP_PRE_STAT_TIMEOUT}
30+ sleep_until ${RTPP_PRE_STAT_TIMEOUT}
2731 cat " ${BUILDDIR} /rtpproxy.stats.input"
28- RTPP_STAT_TIMEOUT=$(( ${RTPP_STAT_TIMEOUT} - ${RTPP_PRE_STAT_TIMEOUT} ))
2932 fi
30- sleep ${RTPP_STAT_TIMEOUT}
33+ sleep_until ${RTPP_STAT_TIMEOUT}
3134 cat " ${BUILDDIR} /rtpproxy.stats.input"
3235}
3336
@@ -166,7 +169,7 @@ start_mm() {
166169
167170 ALICE_ARGS=" ${ALICE_ARGS:- " -46" } "
168171 echo ${MM_PID} > " ${MM_PIDF} "
169- sleep ${MM_INIT_DELAY}
172+ sleep_until ${MM_INIT_DELAY}
170173 return 0
171174}
172175
@@ -277,7 +280,7 @@ if [ ${ALICE_RC} -eq 0 -a ${BOB_RC} -eq 0 -a ${MM_RC} -eq 0 ]
277280then
278281 # Always give the RTPproxy enough time to execute final stats command,
279282 # before we SIGHUP it
280- ${PYTHON_CMD} -c " from time import time, sleep; tleft= ${SIPLOG_TSTART} + ${RTPP_STAT_TIMEOUT} + 5 - time(); sleep(tleft) if tleft > 0 else False; "
283+ sleep_until $(( ${RTPP_STAT_TIMEOUT} + 6 ))
281284fi
282285if [ " ${RTPPC_TYPE} " != " rtp.io" ]
283286then
You can’t perform that action at this time.
0 commit comments