Skip to content

Commit

Permalink
Hard fail rather than sed
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Feb 8, 2024
1 parent b4132ba commit b8e8baa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions install/check-memcached-backend.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
echo "${_group}Checking memcached backend ..."

if grep -q "\.PyMemcacheCache" "$SENTRY_CONFIG_PY"; then
echo "found PyMemcacheCache in $SENTRY_CONFIG_PY, looks good"
echo "PyMemcacheCache found in $SENTRY_CONFIG_PY, gonna assume you're good."
else
if grep -q "\.MemcachedCache" "$SENTRY_CONFIG_PY"; then
echo "found MemcachedCache in $SENTRY_CONFIG_PY, switching to PyMemcacheCache"
sed -i '' -e 's/\.MemcachedCache/.PyMemcacheCache/' "$SENTRY_CONFIG_PY"
sed -i '' -e 's/^\( *\)"server_max_value_length.*$/\1"ignore_exc": True,/' "$SENTRY_CONFIG_PY"
echo "MemcachedCache found in $SENTRY_CONFIG_PY, you should switch to PyMemcacheCache."
echo "See:"
echo " https://develop.sentry.dev/self-hosted/releases/#breaking-changes"
exit 1
else
echo 'weird setup, good luck'
echo 'Your setup looks weird. Good luck.'
fi
fi

Expand Down

0 comments on commit b8e8baa

Please sign in to comment.