web: fix query handle leak
IndexResource and IncompleteURLRedirectResource handlers opened a BerkeleyDB query handle but never called query.close(), leaking file descriptors on every redirect request. Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
This commit is contained in:
parent
453580252b
commit
a54519731f
1 changed files with 2 additions and 0 deletions
|
|
@ -210,6 +210,7 @@ class IndexResource:
|
|||
status=falcon.HTTP_INTERNAL_SERVER_ERROR)
|
||||
|
||||
version = query.get_latest_tag(rc=False)
|
||||
query.close()
|
||||
resp.status = falcon.HTTP_FOUND
|
||||
resp.location = stringify_source_path(project, version, '/')
|
||||
return
|
||||
|
|
@ -366,6 +367,7 @@ class IncompleteURLRedirectResource:
|
|||
rc = version == 'latest-rc'
|
||||
version = query.get_latest_tag(rc=rc)
|
||||
|
||||
query.close()
|
||||
resp.status = falcon.HTTP_FOUND
|
||||
resp.location = stringify_source_path(project, version, '/')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue