Make namespace deletion asynchronous
Instead of deleting a namespace synchronously as before, we now mark the namespace for deletion, disable it, and rename it. A worker then comes along and deletes the namespace in the background. This results in a *significantly* better user experience, as the namespace deletion operation now "completes" in under a second, where before it could take 10s of minutes at the worse. Fixes https://jira.coreos.com/browse/QUAY-838
This commit is contained in:
parent
d9015a1863
commit
8bc55a5676
21 changed files with 244 additions and 129 deletions
|
@ -6,7 +6,7 @@ from flask import request
|
|||
|
||||
import features
|
||||
|
||||
from app import billing as stripe, avatar, all_queues, authentication
|
||||
from app import billing as stripe, avatar, all_queues, authentication, namespace_gc_queue
|
||||
from endpoints.api import (resource, nickname, ApiResource, validate_json_request, request_error,
|
||||
related_user_resource, internal_only, require_user_admin, log_action,
|
||||
show_if, path_param, require_scope, require_fresh_login)
|
||||
|
@ -217,7 +217,7 @@ class Organization(ApiResource):
|
|||
except model.InvalidOrganizationException:
|
||||
raise NotFound()
|
||||
|
||||
model.user.delete_user(org, all_queues)
|
||||
model.user.mark_namespace_for_deletion(org, all_queues, namespace_gc_queue)
|
||||
return '', 204
|
||||
|
||||
raise Unauthorized()
|
||||
|
|
Reference in a new issue