Skip to content

Commit

Permalink
Rename SLEEP_DELAY to POLLING_INTERVAL
Browse files Browse the repository at this point in the history
  • Loading branch information
otherguy committed Feb 15, 2021
1 parent 26143db commit 71c6efe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ LABEL org.label-schema.vcs-url "https://github.com/otherguy/docker-dropbo
LABEL org.label-schema.vcs-ref "${VCS_REF}"

# Configurable sleep delay
ENV SLEEP_DELAY=5
ENV POLLING_INTERVAL=5

# Install init script and dropbox command line wrapper
COPY docker-entrypoint.sh /
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ files. Defaults to `1000`.
If set to `true`, skips updating the Dropbox app on container startup. _Note:_ This is not very reliable
because the Dropbox daemon will still try to update itself even if this is set to `true`.

- `SLEEP_DELAY`
- `POLLING_INTERVAL`
Needs to be set to a positive integer value. The Dropbox daemon is polled for its status at regular intervals,
which can be configured to reduce load on the system. This is the number in seconds to wait between polling the
Dropbox daemon. Defaults to `5`.
Expand Down
8 changes: 4 additions & 4 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ if [ -z "$(grep ":${DROPBOX_GID}:" /etc/group)" ]; then
groupadd -g $DROPBOX_GID dropbox
fi

if [[ ! "${SLEEP_DELAY}" =~ ^[0-9]+$ ]]; then
echo "SLEEP_DELAY not set to a valid number, defaulting to 5!"
export SLEEP_DELAY=5
if [[ ! "${POLLING_INTERVAL}" =~ ^[0-9]+$ ]]; then
echo "POLLING_INTERVAL not set to a valid number, defaulting to 5!"
export POLLING_INTERVAL=5
fi

# Set dropbox account's UID/GID.
Expand Down Expand Up @@ -106,5 +106,5 @@ sleep 5
while kill -0 ${DROPBOX_PID} 2> /dev/null; do
[ -d "/proc/${DROPBOX_PID}" ] && [ -f "/opt/dropbox/.dropbox/info.json" ] && gosu dropbox dropbox status
/usr/bin/find /tmp -maxdepth 1 -type d -mtime +1 -exec rm -rf {} \;
/bin/sleep ${SLEEP_DELAY}
/bin/sleep ${POLLING_INTERVAL}
done

0 comments on commit 71c6efe

Please sign in to comment.