diff --git a/management/commands/pdk_process_bundles.py b/management/commands/pdk_process_bundles.py index a027731..057c415 100644 --- a/management/commands/pdk_process_bundles.py +++ b/management/commands/pdk_process_bundles.py @@ -30,7 +30,7 @@ def add_arguments(self, parser): @handle_lock def handle(self, *args, **options): to_delete = [] - + supports_json = install_supports_jsonfield() default_tz = timezone.get_default_timezone() @@ -70,4 +70,4 @@ def handle(self, *args, **options): for bundle in to_delete: bundle.delete() - logging.debug("%d unprocessed payloads remaining.", DataBundle.objects.filter(processed=False).count()) + logging.debug("%d unprocessed payloads remaining.", DataBundle.objects.filter(processed=False).count()) diff --git a/models.py b/models.py index 1fe0278..b0440e5 100644 --- a/models.py +++ b/models.py @@ -208,7 +208,7 @@ def update_performance_metadata(self): generator['last_recorded'] = calendar.timegm(last_recorded.recorded.timetuple()) generator['first_created'] = calendar.timegm(first_point.created.timetuple()) generator['last_created'] = calendar.timegm(last_point.created.timetuple()) - + duration = (last_point.created - first_point.created).total_seconds() if generator['points_count'] > 1 and duration > 0: diff --git a/views.py b/views.py index bc8b2d4..e579eb6 100644 --- a/views.py +++ b/views.py @@ -6,7 +6,6 @@ import os from django.conf import settings -from django.core.management import call_command from django.http import HttpResponse, HttpResponseNotAllowed, JsonResponse, HttpResponseNotFound, \ FileResponse, UnreadablePostError from django.shortcuts import render @@ -113,8 +112,6 @@ def add_data_bundle(request): # pylint: disable=too-many-statements bundle.save() - # call_command('pdk_process_bundles') - return response elif request.method == 'POST': @@ -156,8 +153,6 @@ def add_data_bundle(request): # pylint: disable=too-many-statements data_file.content_file.save(value.name, value) data_file.save() - # call_command('pdk_process_bundles') - return response elif request.method == 'OPTIONS': response = HttpResponse('', content_type='text/plain', status=200)