diff --git a/scripts/setup/flush-memcached b/scripts/setup/flush-memcached new file mode 100755 index 0000000000..ede74ea66e --- /dev/null +++ b/scripts/setup/flush-memcached @@ -0,0 +1,4 @@ +#!/bin/sh -xe + +# Flush memcached +echo 'flush_all' | nc localhost 11211 diff --git a/scripts/setup/postgres-init-db b/scripts/setup/postgres-init-db index 88432d93dc..34b0e0449d 100755 --- a/scripts/setup/postgres-init-db +++ b/scripts/setup/postgres-init-db @@ -15,5 +15,7 @@ CREATE SCHEMA zulip AUTHORIZATION zulip; CREATE EXTENSION tsearch_extras SCHEMA zulip; EOF +sh "$(dirname "$0")/flush-memcached" + echo "Database created" diff --git a/tools/do-destroy-rebuild-database b/tools/do-destroy-rebuild-database index 7f8ac5af2b..f2323fdbe7 100755 --- a/tools/do-destroy-rebuild-database +++ b/tools/do-destroy-rebuild-database @@ -5,6 +5,8 @@ DROP DATABASE IF EXISTS zulip; CREATE DATABASE zulip TEMPLATE zulip_base; EOF +sh "$(dirname "$0")/../scripts/setup/flush-memcached" + python manage.py migrate --noinput python manage.py createcachetable third_party_api_results python manage.py populate_db -n100 --threads=1 diff --git a/tools/generate-fixtures b/tools/generate-fixtures index 97f917aef7..879406fd53 100755 --- a/tools/generate-fixtures +++ b/tools/generate-fixtures @@ -15,6 +15,7 @@ if [ "$template_grep_error_code" == "0" ]; then DROP DATABASE IF EXISTS zulip_test; CREATE DATABASE zulip_test TEMPLATE zulip_test_template; EOF + sh "$(dirname "$0")/../scripts/setup/flush-memcached" exit 0 fi fi @@ -25,6 +26,7 @@ psql -h localhost postgres zulip_test <