Skip to content

Commit

Permalink
Update timelapse.sh: Add more mini-timelapse debugging statements
Browse files Browse the repository at this point in the history
to help debug simultaneous mini-timelapse issues
  • Loading branch information
EricClaeys authored Sep 18, 2023
1 parent fe846fe commit 358b536
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/timelapse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ while [[ $# -gt 0 ]]; do
IMAGES_FILE="${2}"
shift
;;
--last) # this is just so the last image name appears in "ps" output
shift
;;
-m | --mini)
IS_MINI="true"
;;
Expand Down Expand Up @@ -124,7 +127,7 @@ if [[ ${DEBUG} == "true" ]]; then
[[ ${IS_MINI} == "true" ]] && MSG="${MSG} mini "
MSG="${MSG}timelapse"
[[ -n ${LAST_IMAGE} ]] && MSG="${MSG}, last image = $( basename "${LAST_IMAGE}" )"
echo -e "${MSG}, my PID=$$.${NC}"
echo -e "${MSG}, my PID=${MY_PID}.${NC}"
fi

if [[ ${LOCK} == "true" ]]; then
Expand All @@ -135,8 +138,8 @@ if [[ ${LOCK} == "true" ]]; then
echo " > No ALLSKY_TIMELAPSE_PID_FILE"
fi
fi
ABORTED_MSG1="Another timelapse creation is in progress so this one was aborted."
ABORTED_FIELDS="$( basename "${OUTPUT_FILE}" )"
ABORTED_MSG1="Another timelapse creation is in progress so this one (${PPID}) was aborted."
ABORTED_FIELDS="$( basename "${OUTPUT_FILE}" )\tMY_PID=${MY_PID}\tPPID=${PPID}"
ABORTED_MSG2="timelapse creations"
if [[ ${IS_MINI} == "true" ]]; then
CAUSED_BY="This could be caused by unreasonable TIMELAPSE_MINI_IMAGES and TIMELAPSE_MINI_FREQUENCY settings."
Expand Down Expand Up @@ -307,13 +310,14 @@ fi

# timelapse is uploaded via generateForDay.sh (usually via endOfNight.sh), which called us.

MY_PID="$$"
if [[ ${DEBUG} == "true" ]]; then
# Output one string so it's all on one line in log file.
MSG="${ME}: ${GREEN}"
[[ ${IS_MINI} == "true" ]] && MSG="${MSG}mini "
MSG="${MSG}timelapse creation finished"
[[ -n ${LAST_IMAGE} ]] && MSG="${MSG}, last image = $( basename "${LAST_IMAGE}" )"
echo -e "${MSG}, my PID=$$.${NC}"
echo -e "${MSG}, my PID=${MY_PID}.${NC}"
fi

# Let our parent remove ${ALLSKY_TIMELAPSE_PID_FILE} when done.
Expand Down

0 comments on commit 358b536

Please sign in to comment.