<commit_before>#!/usr/bin/env bash

# This file is part of Mconf-Web, a web application that provides access
# to the Mconf webconferencing system. Copyright (C) 2010-2013 Mconf
#
# This file is licensed under the Affero General Public License version
# 3 or later. See the LICENSE file.

# Wrapper script to run resque from monit
# Arguments:
#   $1: (start|stop)
#   $2: queue name, e.g. 'bigbluebutton_rails'
# Example:
#   start_resque_workers.sh start bigbluebutton_rails
#   start_resque_workers.sh start all

USER="$(id -u -n)"
APP_PATH="$(dirname $0)/.."
PATH=/home/$USER/.rbenv/bin:/home/$USER/.rbenv/shims:$PATH
RAILS_ENV=production

if [ "$2" == "all" ]; then
  PIDFILE=$APP_PATH/tmp/pids/resque_workers_all.pid
  LOGFILE=$APP_PATH/log/resque_workers_all.log
else
  PIDFILE=$APP_PATH/tmp/pids/resque_workers_$2.pid
  LOGFILE=$APP_PATH/log/resque_workers_$2.log
fi

cd $APP_PATH

if [ "$1" != "stop" ]; then
  if [ "$2" == "all" ]; then
    /usr/bin/env bundle exec rake environment resque:work RAILS_ENV=$RAILS_ENV PIDFILE=$PIDFILE VERBOSE=1 QUEUE="*" >> $LOGFILE 2>&1
  else
    /usr/bin/env bundle exec rake environment resque:work RAILS_ENV=$RAILS_ENV PIDFILE=$PIDFILE VERBOSE=1 QUEUE=$2 >> $LOGFILE 2>&1
  fi
else
  kill -9 $(cat $PIDFILE) && rm -f $PIDFILE; exit 0;
fi<commit_msg>Run 3 resque workers by default instead of 1<commit_after>#!/usr/bin/env bash

# This file is part of Mconf-Web, a web application that provides access
# to the Mconf webconferencing system. Copyright (C) 2010-2013 Mconf
#
# This file is licensed under the Affero General Public License version
# 3 or later. See the LICENSE file.

# Wrapper script to run resque from monit
# Arguments:
#   $1: (start|stop)
#   $2: queue name, e.g. 'bigbluebutton_rails'
# Example:
#   start_resque_workers.sh start bigbluebutton_rails
#   start_resque_workers.sh start all

USER="$(id -u -n)"
APP_PATH="$(dirname $0)/.."
PATH=/home/$USER/.rbenv/bin:/home/$USER/.rbenv/shims:$PATH
RAILS_ENV=production

if [ "$2" == "all" ]; then
  PIDFILE=$APP_PATH/tmp/pids/resque_workers_all.pid
  LOGFILE=$APP_PATH/log/resque_workers_all.log
else
  PIDFILE=$APP_PATH/tmp/pids/resque_workers_$2.pid
  LOGFILE=$APP_PATH/log/resque_workers_$2.log
fi

cd $APP_PATH

if [ "$1" != "stop" ]; then
  if [ "$2" == "all" ]; then
    /usr/bin/env bundle exec rake environment resque:workers RAILS_ENV=$RAILS_ENV PIDFILE=$PIDFILE VERBOSE=1 QUEUE="*" COUNT="3" >> $LOGFILE 2>&1
  else
    /usr/bin/env bundle exec rake environment resque:workers RAILS_ENV=$RAILS_ENV PIDFILE=$PIDFILE VERBOSE=1 QUEUE=$2 COUNT="3" >> $LOGFILE 2>&1
  fi
else
  kill -9 $(cat $PIDFILE) && rm -f $PIDFILE; exit 0;
fi
{'fraction_non_alphanumeric': 0.13741034352585882, 'fraction_numerical': 0.021140052850132124, 'mean_word_length': 4.463917525773196, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5371295', 'n_tokens_mistral': 1050, 'n_tokens_neox': 993, 'n_words': 263}