Skip to content

Commit

Permalink
Removing apscheduler: we don't want to pay for a full dyno when the t…
Browse files Browse the repository at this point in the history
…ask is running for 10s every sunday
  • Loading branch information
Lucie Daeye committed Jun 25, 2018
1 parent 732d44a commit 872f606
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 40 deletions.
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ requests = "*"
factory_boy = "*"
Faker = "*"
wagtail-factories = {git = "https://github.com/mvantellingen/wagtail-factories@1ead51cadaad3b4530ba2197ccf45d2dca87dbdf", editable=true}
apscheduler = "*"

[dev-packages]
coverage = "*"
Expand Down
22 changes: 7 additions & 15 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
release: cd network-api && python ./manage.py migrate --no-input
web: cd network-api && gunicorn networkapi.wsgi:application
clock: python network-api/clock.py
12 changes: 0 additions & 12 deletions network-api/clock.py

This file was deleted.

18 changes: 18 additions & 0 deletions network-api/delete_non_staff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os
import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "networkapi.settings")
django.setup()

from django.contrib.auth.models import User # noqa: E402
from django.db.models import Q # noqa: E402

print("Deleting non staff users")
non_staff = User.objects.exclude(Q(email__contains='mozillafoundation,org') | Q(is_staff=True))
if non_staff:
print('Deleting: ')
print(*[e.username for e in non_staff], sep=', ')
non_staff.delete()
else:
print('Nothing to delete')
print("Done!")
11 changes: 0 additions & 11 deletions network-api/networkapi/utility/delete_non_staff.py

This file was deleted.

0 comments on commit 872f606

Please sign in to comment.