Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Restructuring to avoid cicrular dependency in 3rd party deployments
  • Loading branch information
audaciouscode committed May 7, 2017
1 parent 9ad62db commit e3a9ead
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions performance.py
Expand Up @@ -11,9 +11,12 @@
from django.utils import timezone


def append_performance_sample(user, item, detail_date=timezone.now(), value=''):
def append_performance_sample(user, item, detail_date=None, value=''):
from django.conf import settings

if detail_date is None:
detail_date = timezone.now()

os.umask(000)

today = datetime.date.today()
Expand Down Expand Up @@ -43,8 +46,6 @@ def append_performance_sample(user, item, detail_date=timezone.now(), value=''):


def fetch_performance_samples(user, item, start=None, end=None):
from django.conf import settings

if end is None:
end = timezone.now()

Expand All @@ -58,6 +59,8 @@ def fetch_performance_samples(user, item, start=None, end=None):
samples = []

while start_date <= end_date:
from django.conf import settings

item_path = settings.MEDIA_ROOT + '/purple_robot_analytics/' + user + '/' + start_date.isoformat() + '/' + item + '.pickle'

if os.path.exists(item_path):
Expand Down

0 comments on commit e3a9ead

Please sign in to comment.