diff options
author | Dan McGee <dan@archlinux.org> | 2012-07-24 16:19:48 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-07-25 02:57:20 +0200 |
commit | c0bf9e20660cfae7ea8994472555bba23398b598 (patch) | |
tree | 889351fc02d4930233acf3dace3ececda4833c88 /mirrors/management | |
parent | 61b4098c611592d62b40a9ee941976a869dff4fc (diff) | |
download | archweb-c0bf9e20660cfae7ea8994472555bba23398b598.tar.gz archweb-c0bf9e20660cfae7ea8994472555bba23398b598.tar.xz |
Remove custom utc_now() function, use django.utils.timezone.now()
This was around from the time when we handled timezones sanely and
Django did not; now that we are on 1.4 we no longer need our own code to
handle this.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors/management')
-rw-r--r-- | mirrors/management/commands/mirrorcheck.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mirrors/management/commands/mirrorcheck.py b/mirrors/management/commands/mirrorcheck.py index 7a133cb..e09ea68 100644 --- a/mirrors/management/commands/mirrorcheck.py +++ b/mirrors/management/commands/mirrorcheck.py @@ -29,8 +29,9 @@ import urllib2 from django.core.management.base import NoArgsCommand from django.db import transaction +from django.utils.timezone import now -from main.utils import utc_now, database_vendor +from main.utils import database_vendor from mirrors.models import MirrorUrl, MirrorLog logging.basicConfig( @@ -83,7 +84,7 @@ def parse_lastsync(log, data): def check_mirror_url(mirror_url, timeout): url = mirror_url.url + 'lastsync' logger.info("checking URL %s", url) - log = MirrorLog(url=mirror_url, check_time=utc_now()) + log = MirrorLog(url=mirror_url, check_time=now()) headers = {'User-Agent': 'archweb/1.0'} req = urllib2.Request(url, None, headers) try: @@ -136,7 +137,7 @@ def check_mirror_url(mirror_url, timeout): def check_rsync_url(mirror_url, timeout): url = mirror_url.url + 'lastsync' logger.info("checking URL %s", url) - log = MirrorLog(url=mirror_url, check_time=utc_now()) + log = MirrorLog(url=mirror_url, check_time=now()) tempdir = tempfile.mkdtemp() lastsync_path = os.path.join(tempdir, 'lastsync') |