From 40c4eff8c78b0e8c2a3e87bc7263391239635ff7 Mon Sep 17 00:00:00 2001 From: orbitroom Date: Tue, 20 Jan 2015 18:55:51 -0500 Subject: [PATCH 1/9] loadMon.sh allows automated control of the celery scripts when ran as a cron job in order to keep celery from crashing the server due to a loop. --- loadMon.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 loadMon.sh diff --git a/loadMon.sh b/loadMon.sh new file mode 100644 index 00000000..bc6752a2 --- /dev/null +++ b/loadMon.sh @@ -0,0 +1,10 @@ +#!/bin/bash +trigger=5.00 +load=`cat /proc/loadavg | awk '{print $1}'` +response=`echo | awk -v T=$trigger -v L=$load 'BEGIN{if ( L > T){ print "greater"}}'` +if [[ $response = "greater" ]] +then +killall screen +sleep 8m +bash /home/allianceserver/allianceauth/start_bg_tasks.sh +fi From e794d389d72a52989b7b79cadd7e98d61b6c34dd Mon Sep 17 00:00:00 2001 From: orbitroom Date: Tue, 20 Jan 2015 19:00:13 -0500 Subject: [PATCH 2/9] set working directory added code to allow it to be ran from outside of the working directory. --- start_bg_tasks.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 start_bg_tasks.sh diff --git a/start_bg_tasks.sh b/start_bg_tasks.sh new file mode 100644 index 00000000..2973ab2c --- /dev/null +++ b/start_bg_tasks.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd ${0%/*} +screen -dm bash -c 'python manage.py celeryd --verbosity=2 --loglevel=DEBUG' +screen -dm bash -c 'python manage.py celerybeat --verbosity=2 --loglevel=DEBUG' From dcad487e586b60b6baf1a803c381bd7aec5f3078 Mon Sep 17 00:00:00 2001 From: orbitroom Date: Fri, 1 Jan 2016 22:15:51 -0600 Subject: [PATCH 3/9] Added TCU's to Timerboard Added TCU' to Timerboard --- timerboard/form.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timerboard/form.py b/timerboard/form.py index 09653b96..c3a83c02 100755 --- a/timerboard/form.py +++ b/timerboard/form.py @@ -5,7 +5,7 @@ from django.core.validators import MaxValueValidator, MinValueValidator class TimerForm(forms.Form): structure_choices = [('POCO', 'POCO'), ('I-HUB', 'I-HUB'), ('POS[S]', 'POS[S]'), - ('POS[M]', 'POS[M]'), ('POS[L]', 'POS[L]'), ('Station', 'Station'), ('Other', 'Other')] + ('POS[M]', 'POS[M]'), ('POS[L]', 'POS[L]'), ('Station', 'Station'), ('TCU', 'TCU'), ('Other', 'Other')] objective_choices = [('Friendly', 'Friendly'), ('Hostile', 'Hostile'), ('Neutral', 'Neutral')] details = forms.CharField(max_length=254, required=True, label='Details') From 7bdf57bf8baf797a3c6e144bb75b2dcfae3986c5 Mon Sep 17 00:00:00 2001 From: orbitroom Date: Fri, 1 Jan 2016 22:51:15 -0600 Subject: [PATCH 4/9] Added TCU's to Timerboard --- stock/templates/registered/timermanagement.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stock/templates/registered/timermanagement.html b/stock/templates/registered/timermanagement.html index 1b091272..c5a6b16d 100755 --- a/stock/templates/registered/timermanagement.html +++ b/stock/templates/registered/timermanagement.html @@ -94,6 +94,11 @@ Station {% endifequal %} + {% ifequal closest_timer.structure "Station" %} +
+ TCU +
+ {% endifequal %} {% ifequal closest_timer.structure "Other" %}
Other From 5bccf0f1a7736bfa214b042ab3514ca5c0ebb9f2 Mon Sep 17 00:00:00 2001 From: orbitroom Date: Fri, 1 Jan 2016 22:53:48 -0600 Subject: [PATCH 5/9] Update timermanagement.html --- stock/templates/registered/timermanagement.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock/templates/registered/timermanagement.html b/stock/templates/registered/timermanagement.html index c5a6b16d..cbe14b36 100755 --- a/stock/templates/registered/timermanagement.html +++ b/stock/templates/registered/timermanagement.html @@ -94,7 +94,7 @@ Station
{% endifequal %} - {% ifequal closest_timer.structure "Station" %} + {% ifequal closest_timer.structure "TCU" %}
TCU
From f4be05a40b299c6a643275844c56c9a24a8048c8 Mon Sep 17 00:00:00 2001 From: orbitroom Date: Fri, 1 Jan 2016 23:13:03 -0600 Subject: [PATCH 6/9] Added TCU's to Timerboard --- stock/templates/registered/timermanagement.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stock/templates/registered/timermanagement.html b/stock/templates/registered/timermanagement.html index cbe14b36..fe3e08eb 100755 --- a/stock/templates/registered/timermanagement.html +++ b/stock/templates/registered/timermanagement.html @@ -193,7 +193,12 @@
Station
- {% endifequal %} + {% endifequal %} + {% ifequal timer.structure "TCU" %} +
+ TCU +
+ {% endifequal %} {% ifequal timer.structure "Other" %}
Other From 428668c19af5ec2601cd21f883b484f6bf8d647d Mon Sep 17 00:00:00 2001 From: orbitroom Date: Fri, 1 Jan 2016 23:15:31 -0600 Subject: [PATCH 7/9] Delete start_bg_tasks.sh --- start_bg_tasks.sh | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 start_bg_tasks.sh diff --git a/start_bg_tasks.sh b/start_bg_tasks.sh deleted file mode 100644 index 2973ab2c..00000000 --- a/start_bg_tasks.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -cd ${0%/*} -screen -dm bash -c 'python manage.py celeryd --verbosity=2 --loglevel=DEBUG' -screen -dm bash -c 'python manage.py celerybeat --verbosity=2 --loglevel=DEBUG' From ec1823f8abd5d2537eadb190562c930c0c415f4f Mon Sep 17 00:00:00 2001 From: orbitroom Date: Fri, 1 Jan 2016 23:15:40 -0600 Subject: [PATCH 8/9] Delete loadMon.sh --- loadMon.sh | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 loadMon.sh diff --git a/loadMon.sh b/loadMon.sh deleted file mode 100644 index bc6752a2..00000000 --- a/loadMon.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -trigger=5.00 -load=`cat /proc/loadavg | awk '{print $1}'` -response=`echo | awk -v T=$trigger -v L=$load 'BEGIN{if ( L > T){ print "greater"}}'` -if [[ $response = "greater" ]] -then -killall screen -sleep 8m -bash /home/allianceserver/allianceauth/start_bg_tasks.sh -fi From 0fcc34ee2305f9c6c900465113372fb5bd3c5534 Mon Sep 17 00:00:00 2001 From: Trent Bartlem Date: Sat, 2 Jan 2016 16:19:37 +1000 Subject: [PATCH 9/9] #154 only sync TS3 if it's enabled --- celerytask/tasks.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/celerytask/tasks.py b/celerytask/tasks.py index 6aad687f..78063121 100755 --- a/celerytask/tasks.py +++ b/celerytask/tasks.py @@ -46,6 +46,9 @@ def disable_blue_member(user): deactivate_services(user) AuthServicesInfoManager.update_is_blue(False, user) +def is_teamspeak3_active(): + return settings.ENABLE_AUTH_TEAMSPEAK3 or settings.ENABLE_BLUE_TEAMSPEAK3 + def update_jabber_groups(user): syncgroups = SyncGroupCache.objects.filter(user=user) authserviceinfo = AuthServicesInfo.objects.get(user=user) @@ -109,8 +112,8 @@ def update_teamspeak3_groups(user): for filtered_group in filtered_groups: for ts_group in filtered_group.ts_group.all(): groups[ts_group.ts_group_name] = ts_group.ts_group_id - - Teamspeak3Manager.update_groups(authserviceinfo.teamspeak3_uid, groups) + if (is_teamspeak3_active()): + Teamspeak3Manager.update_groups(authserviceinfo.teamspeak3_uid, groups) def update_discord_groups(user): syncgroups = SyncGroupCache.objects.filter(user=user) @@ -210,7 +213,8 @@ def remove_from_databases(user, groups, syncgroups): @periodic_task(run_every=crontab(minute="*/1")) def run_databaseUpdate(): users = User.objects.all() - Teamspeak3Manager._sync_ts_group_db() + if (is_teamspeak3_active()): + Teamspeak3Manager._sync_ts_group_db() for user in users: groups = user.groups.all() syncgroups = SyncGroupCache.objects.filter(user=user)