Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Prevent negative lag in pmp-check-mysql-replication-delay #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wilfriedroset
Copy link

Due to NTP we have an occurence of negative lag (which is not possible). This patch aims to avoid negative lag.


# Prevent Negative value due to NTP
# Keep the highest value between 0 and level
LEVEL=$([ "$LEVEL" -gt "0" ] && echo $LEVEL || echo 0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LEVEL=$([ "$LEVEL" -gt "0" ] && echo $LEVEL || echo 0)
LEVEL=$([ "$LEVEL:-0" -le "0" ] && echo 0 || echo $LEVEL)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants