Skip to content

Commit

Permalink
Federation demo start.sh: Fixed --no-rate-limit param in the script
Browse files Browse the repository at this point in the history
  • Loading branch information
manuroe committed Jun 4, 2015
1 parent da84946 commit 378a0f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
6 changes: 4 additions & 2 deletions demo/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ if [ -f $PID_FILE ]; then
exit 1
fi

find "$DIR" -name "*.log" -delete
find "$DIR" -name "*.db" -delete
for port in 8080 8081 8082; do
rm -rf demo/$port
rm -rf demo/media_store.$port
done

rm -rf $DIR/etc
17 changes: 9 additions & 8 deletions demo/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ cd "$DIR/.."

mkdir -p demo/etc

# Check the --no-rate-limit param
PARAMS=""
if [ $# -eq 1 ]; then
if [ $1 = "--no-rate-limit" ]; then
PARAMS="--rc-messages-per-second 1000 --rc-message-burst-count 1000"
fi
fi

export PYTHONPATH=$(readlink -f $(pwd))


Expand All @@ -35,6 +27,15 @@ for port in 8080 8081 8082; do
-H "localhost:$https_port" \
--config-path "$DIR/etc/$port.config" \

# Check script parameters
if [ $# -eq 1 ]; then
if [ $1 = "--no-rate-limit" ]; then
# Set high limits in config file to disable rate limiting
perl -p -i -e 's/rc_messages_per_second.*/rc_messages_per_second: 1000/g' $DIR/etc/$port.config
perl -p -i -e 's/rc_message_burst_count.*/rc_message_burst_count: 1000/g' $DIR/etc/$port.config
fi
fi

python -m synapse.app.homeserver \
--config-path "$DIR/etc/$port.config" \
-D \
Expand Down

0 comments on commit 378a0f7

Please sign in to comment.