Skip to content

Commit

Permalink
Corrected test for updating cache
Browse files Browse the repository at this point in the history
Removed spurious ")" from first clause so it's true only when current "fingerprint" and cached "fingerprint" actually differ.
OR instead of AND so that updates don't happen only in the first 120 seconds after the machine is rebooted.
  • Loading branch information
Jon1760 authored Nov 11, 2021
1 parent d771fc9 commit f4b2706
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions agents/plugins/yum
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ fi
echo "<<<yum>>>"

# compare current and cached yum information
if [ "$YUM_CURRENT" != "$YUM_CACHED)" ] && [ ! -s $CACHE_RESULT_CHECK ]
# Update cached data if YUM fingerprint has changed OR machine has recently rebooted.
if [ "$YUM_CURRENT" != "$YUM_CACHED" ] || [ ! -s $CACHE_RESULT_CHECK ]
then
count=0
while [ -n "$(pgrep -f "python /usr/bin/yum")" ]; do
Expand Down Expand Up @@ -122,4 +123,4 @@ then
else
# use cache file
cat $CACHE_RESULT_CHECK
fi
fi

0 comments on commit f4b2706

Please sign in to comment.