Skip to content

Commit

Permalink
Add bedrock to sys.path in cron.py so imports will work (#5711)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmac authored and jgmize committed May 16, 2018
1 parent b5fa181 commit 4560ff8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bin/cron.py
Expand Up @@ -12,8 +12,16 @@
from apscheduler.schedulers.blocking import BlockingScheduler
from pathlib2 import Path

from bedrock.base.config_manager import config

# ROOT path of the project. A pathlib.Path object.
ROOT_PATH = Path(__file__).resolve().parents[1]
ROOT = str(ROOT_PATH)

# add bedrock to path
sys.path.append(ROOT)

# must import after adding bedrock to path
from bedrock.base.config_manager import config # noqa

# these are the defaults, but explicit is better
JOB_DEFAULTS = {
Expand All @@ -30,9 +38,6 @@
# Dead Man's Snitch
DEAD_MANS_SNITCH_URL = config('DEAD_MANS_SNITCH_URL', default='')

# ROOT path of the project. A pathlib.Path object.
ROOT_PATH = Path(__file__).resolve().parents[1]
ROOT = str(ROOT_PATH)
MANAGE = str(ROOT_PATH / 'manage.py')
HEALTH_FILE_BASE = '/tmp/last-run'

Expand Down

0 comments on commit 4560ff8

Please sign in to comment.