optimized imports, added defaults to env

This commit is contained in:
Jared Murrell 2020-06-30 23:33:06 -04:00
Родитель b69566e307
Коммит 0d2cd6030f
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -1,15 +1,14 @@
import import_env_file
import os
from distutils.util import strtobool
from .core import GitHubApp
from .ldap import LDAPClient
from .version import __version__
__all__ = ['GitHubApp', 'LDAPClient']
# Set default logging handler to avoid "No handler found" warnings.
import logging
from logging import NullHandler
# Set initial level to WARN. Users must manually enable logging for
# flask_githubapp to see our logging.
@ -19,4 +18,8 @@ rootlogger = logging.getLogger(__name__)
if rootlogger.level == logging.NOTSET:
rootlogger.setLevel(logging.WARN)
CRON_INTERVAL = os.environ['SYNC_SCHEDULE']
CRON_INTERVAL = os.environ.get('SYNC_SCHEDULE', '0 * * * *')
CHANGE_THRESHOLD = os.environ.get('CHANGE_THRESHOLD', 25)
REPO_FOR_ISSUES = os.environ.get('REPO_FOR_ISSUES')
ISSUE_ASSIGNEE = os.environ.get('ISSUE_ASSIGNEE')
OPEN_ISSUE_ON_FAILURE = strtobool(os.environ.get('OPEN_ISSUE_ON_FAILURE', False))