Age | Commit message (Collapse) | Author |
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
And re-indent the URL details log template now that we've broken it out.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Yay for way improved performance. Local testing showed render times
going from 265 ms to 135 ms.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Anytime we have a loop with >100 items, the Django template engine
begins to be the bottleneck. This one is relatively straightforward to
convert, and sets the stage for converting the mirror status page as
well.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
* Add country column to main mirror list overview page. Most mirrors are
strictly in one country, so do a little magic to show the right
country if it makes sense.
* Use new way of getting country names so we respect the overrides now
present in the django_countries package.
* Make the country selection box on the mirrorlist generation page a lot
taller by default so it is easier to use.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Not using this anywhere just yet, but suggested by Florian so we can do
some more fancy things down the road, like determine bandwidth by
country.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We've moved this around a few times, including changing the parameters
to ensure they are stable (commit bdfa22500f4). However, the bulk of the
work takes place in the mashing up of the data, so cache the full result
rather than just the result of a single query.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Get rid of all the junk trying to only return URLs that have been
checked in the last 24 hours; it just isn't worth it. Instead, do that
screening only in the views that need it, namely the HTML status page.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Do a few things to speed up the encoding of the JSON, including better
usage of list comprehensions, less dynamic setattr() usage, and removal
of the queryset specialization since we can easily do it outside of the
encoder.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Ensure we always coerce values to unicode in our __unicode__ method, and
remove some now unneeded verbosity and comments since the upstream bug
has been fixed.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Django 1.7 has built-in migrations support, so we no longer want these
around. All existing installs should be fully migrated at this point to
the latest schema.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
When things blow up in low-level C code, the tuple is sometimes of
length one, such as when it contains this error message:
_ssl.c:495: The handshake operation timed out
Just use the last element of the tuple, which works for all of the
cases.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Requested by Florian to make leaving notes on mirrors a bit easier.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This will make it easier in the future to clear out inactive mirrors
that haven't been touched in a while.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We can use this on both the HTML and JSON views of this data to prevent
recomputation for smart clients that respect the modified date header.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We were missing two duration-related attributes here, causing some 500
errors to happen if we had cached status_data around that didn't agree
with our current list of checked mirrors. Don't blow up on the JSON data
fetch by ensuring we provide a value, even if it is out of date.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This will work with both the newer and older versions.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This will allow those that care about mirrors to zoom into URL-level
details for each mirror and examine the individual check results.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
It doesn't do much good to mark a function as cacheable if we call it
every single time with different arguments due to using the current date
and time. Fix it by passing the offset in instead.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Regardless of whether the mirror URL is active or not, we often have
data we can show the end user, especially if mirror admins care to see
the data we've been gathering.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
It turns out this is a HUGE part of our slow mirror status template
rendering, due to the internal workings. Everything is converted to a
Python decimal object which is way slower than just staying in native
floating point. Given we are always dealing with floats when we need to
do our formatting, a home-rolled template tag can accomplish this much
faster.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
PendingDeprecationWarning: commit_on_success is deprecated in favor of atomic.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
PendingDeprecationWarning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form needs updating
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We sometimes record a duration even on a failed fetch attempt, such as
if we get an HTTP 404. However, we never record a last_sync value on a
failed fetch. Use this field instead to sum up the total number of
successful checks.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This should be a small enough chunk of data that it isn't super
expensive to put into and pull out of memcached.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This fixes things up on the download page as well as the individual
mirror details page.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
FTP is a terrible protocol these days compared to HTTP. IPv6 support is
spotty at best, it is much slower for the connect/begin transfer cycle,
and overall just doesn't provide anything HTTP does better. Start
killing bits that we've added to treat FTP as a first-class protocol and
regulate it to the back seat.
The expectation here is once this commit goes live to the production
site, the FTP mirror URLs themselves will get removed completely from
the database, and the FTP protocol object itself will get deleted.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Give a window of 7 days for logs here rather than the default 24 hours
we do on the main status page since we are only retrieving details for a
single mirror with a handful of URLs. This should make it easier to have
all information regarding one mirror in a single location.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
If certain attributes came back from the database as NULL, we had issues
parsing them. Pass None/NULL straight through rather than trying to
type-convert.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Most of these were suggested by PyCharm, and include everything from
little syntax issues and other bad smells to dead or bad code.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This is only used in one place, so it makes more sense for it to not be
globally accessible.
Signed-off-by: Dan McGee <dan@archlinux.org>
|