Add a worker for reporting global stats to Prometheus

Fixes #1789
This commit is contained in:
Joseph Schorr 2016-09-12 16:19:19 -04:00
parent 818ea38dac
commit 30af8aef1a
5 changed files with 72 additions and 0 deletions

View file

@ -137,6 +137,10 @@ def get_organizations():
return User.select().where(User.organization == True, User.robot == False)
def get_active_org_count():
return get_organizations().count()
def add_user_as_admin(user_obj, org_obj):
try:
admin_role = TeamRole.get(name='admin')