# HG changeset patch # User Brian Neal # Date 1424401341 21600 # Node ID e7c549e4dbf77aae2f9ba153dbba66ffe6ca5c2e # Parent 101728976f9c26a900e3b8ba26cd3c6fbdab380c Add counter and timer. diff -r 101728976f9c -r e7c549e4dbf7 core/management/commands/ssl_images.py --- a/core/management/commands/ssl_images.py Wed Feb 18 21:20:31 2015 -0600 +++ b/core/management/commands/ssl_images.py Thu Feb 19 21:02:21 2015 -0600 @@ -7,6 +7,7 @@ an S3 bucket. The src attribute is replaced with the new S3 URL. """ import base64 +import datetime import httplib import logging from optparse import make_option @@ -312,6 +313,7 @@ ) def handle_noargs(self, **options): + time_started = datetime.datetime.now() _setup_logging() logger.info("Starting; arguments received: %s", options) @@ -363,6 +365,7 @@ if i is None: i = 0 + count = 0 for n, model in enumerate(qs.iterator()): if quit_flag: logger.warning("SIGINT received, exiting") @@ -384,5 +387,9 @@ # the model again to force updated HTML to be created. logger.info("Older Smiley HTML detected, forcing a save") model.save() + count += 1 - logger.info("ssl_images exiting") + time_finished = datetime.datetime.now() + elapsed = time_finished - time_started + logger.info("ssl_images exiting; number of objects: %d; elapsed: %s", + count, elapsed)