Age | Commit message (Collapse) | Author |
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This moves most migrations to the v2 format that have been presenting
some issues. One missing depends_on relationship has been added, and we
allow an index to not be dropped if it does not exist due to the
shittyness in sqlite3 actually keeping indexes across DDL on that table.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
The reason for this is documented in the middleware itself. Without
this, pgbouncer is of little use to us since it has to throw away every
connection we try to route through it because of unclean disconnects.
In theory, with the switch to using pgbouncer for all WSGI originating
connections and adding this middleware, we should see a notable decrease
in connection time to the database.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
A few minor things are fixed here. One is PostgreSQL, and more
specifically pgbouncer, don't like it when the connection is closed
after psycopg2 has started an implicit transaction even for read-only
queries. Ensure we call commit as our last database action in all cases.
The other is related- Django in management commands doesn't ever call
close on any database connection you may have been using, so PostgreSQL
gets mad about this fact and logs a message saying such. Close the
connection explicitly when we are done with it to play nice.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Just as we do for the normal status HTML view.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Less noticeable in production as the templates don't show
'@@@INVALID@@@' there, but we were trying to access attributes that
don't actually exist on certain mirror objects.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We now always look for this information at the URL level, not the mirror
level. This simplifies quite a bit of code in and around the mirror
views.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Rather than have the weird indirection we need now to find the right
country for URLs, just always store it on the URL.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Bug #16519 in Django deprecates mimetype, so update our code
accordingly.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This should hopefully allow these views to not be labeled as
'_wrapped_view' in performance monitoring output.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This is the default now in Django anyway:
https://code.djangoproject.com/ticket/7317
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Their code stupidly grabs the environment variable during import, not
during the initialize call.
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>
|
|
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 were peppering the database with a bunch of queries here; using
prefetch_related and attach_maintainers can cut down the count
significantly.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This seems to generate much more performant queries at the database
level than what we were previously doing, and also doesn't show
duplicate rows.
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>
|
|
This will allow us to see who last changed the status of a todolist
item.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This makes it easier to see the progression of a todolist and its
contents easier since we are no longer losing the data.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Due to pgp_signature being added to the Package model, we need to depend
on this later change as well.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This will be used to eventually implement the UI side of FS#13441, but
to do that, we first need the data.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This will be utilized to soft-delete items from the list if the packages
are modified, rather than deleting them outright.
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>
|
|
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're not using any of the injected values these context processors
provide in our templates, so remove them from our default config.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This is the preferred and non-deprecated way of doing this in Django
1.4+.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
See https://docs.djangoproject.com/en/1.4/ref/clickjacking/ for details.
This middleware was added to the default configuration in Django 1.4.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
A lot like skipping fetching of the news content; we definitely don't
need this just to list the todolists on index pages.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Since we need these in the template for any details links, we might as
well pull them back from the database in one query rather than three.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Given the way we retrieve certain related objects, it makes more sense
to use a custom tag here rather than our generic package details link
tag. When viewing a large todolist, this saves significantly on the
number of queries we need to build the page.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Django doesn't attach the parent object to the child objects, even when
queried through the related manager. This causes up to 3 extra queries:
one to retrieve the package again, and one each for arch and repo
retrieval.
For a package like archboot, this drops the number of necessary queries
for the package page from 805 to 222 (yes, this is still too high) and
cuts the time spent waiting on the database from 505ms to 262ms.
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>
|
|
This is ripped off from commit 7c92ddbd3c86d when we added slugs to
News objects.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This will be used to make more descriptive URLs for our todolists. The
`null=True` bit will be removed once a data migration is added to add
slugs to all previously created todolists.
Signed-off-by: Dan McGee <dan@archlinux.org>
|