Skip to content

Commit

Permalink
MAX_DAYS_OF_YEAR_RANGED_ARG mapping and add FORCE_UPDATE_ARG
Browse files Browse the repository at this point in the history
  • Loading branch information
EugenMayer committed Feb 17, 2025
1 parent 21a9975 commit 255513e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions vulnz/src/docker/scripts/mirror.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@ if [ -n "${MAX_RECORDS_PER_PAGE}" ]; then
MAX_RECORDS_PER_PAGE_ARG="--recordsPerPage=$MAX_RECORDS_PER_PAGE"
fi

MAX_DAYS_OF_YEAR_RANGED=""
if [ -n "${DEBUG}" ]; then
MAX_DAYS_OF_YEAR_RANGED_ARG=""
if [ -n "${$MAX_DAYS_OF_YEAR_RANGED}" ]; then
echo "Enabling debug mode"
MAX_DAYS_OF_YEAR_RANGED_ARG="--maxDaysOfYearRange=$MAX_DAYS_OF_YEAR_RANGED"
fi

FORCE_UPDATE_ARG=""
if [ -n "${FORCE_UPDATE}" ]; then
echo "Enabling debug mode"
FORCE_UPDATE_ARG="--forceUpdate"
fi

DEBUG_ARG=""
if [ -n "${DEBUG}" ]; then
echo "Enabling debug mode"
Expand All @@ -59,7 +65,7 @@ max_attempts=5

set +e
while [ $attempt -le $max_attempts ]; do
java $JAVA_OPT -jar /usr/local/bin/vulnz cve $DELAY_ARG $DEBUG_ARG $MAX_RETRY_ARG $MAX_RECORDS_PER_PAGE_ARG $MAX_DAYS_OF_YEAR_RANGED_ARG --cache --directory /usr/local/apache2/htdocs
java $JAVA_OPT -jar /usr/local/bin/vulnz cve $DELAY_ARG $DEBUG_ARG $MAX_RETRY_ARG $MAX_RECORDS_PER_PAGE_ARG $MAX_DAYS_OF_YEAR_RANGED_ARG $FORCE_UPDATE_ARG --cache --directory /usr/local/apache2/htdocs
exit_code=$?
# 100: one or more years of data failed to update; 101 there was an error updating the modified CVE list
# if either of these codes are returned, we will retry the update immediately
Expand Down

0 comments on commit 255513e

Please sign in to comment.