Implement a worker for batch exporting of usage logs
This will allow customers to request their usage logs for a repository or an entire namespace, and we can export the logs in a manner that doesn't absolutely destroy the database, with every step along the way timed.
This commit is contained in:
parent
b8d2e1be9c
commit
8a212728a3
18 changed files with 768 additions and 15 deletions
|
@ -16,6 +16,7 @@ INTERNAL_ONLY_PROPERTIES = {
|
|||
'SECURITY_SCANNER_ISSUER_NAME',
|
||||
'NOTIFICATION_QUEUE_NAME',
|
||||
'NAMESPACE_GC_QUEUE_NAME',
|
||||
'EXPORT_ACTION_LOGS_QUEUE_NAME',
|
||||
|
||||
'FEATURE_BILLING',
|
||||
'BILLING_TYPE',
|
||||
|
|
|
@ -166,6 +166,16 @@ def send_invoice_email(email, contents):
|
|||
mail.send(msg)
|
||||
|
||||
|
||||
def send_logs_exported_email(email, export_id, status, exported_data_url=None,
|
||||
exported_data_expiration=None):
|
||||
send_email(email, 'Export Action Logs Complete', 'logsexported', {
|
||||
'status': status,
|
||||
'export_id': export_id,
|
||||
'exported_data_url': exported_data_url,
|
||||
'exported_data_expiration': exported_data_expiration,
|
||||
})
|
||||
|
||||
|
||||
# INTERNAL EMAILS BELOW
|
||||
|
||||
def send_subscription_change(change_description, customer_id, customer_email, quay_username):
|
||||
|
@ -182,5 +192,3 @@ def send_subscription_change(change_description, customer_id, customer_email, qu
|
|||
msg.html = SUBSCRIPTION_CHANGE.format(change_description, customer_id, customer_email,
|
||||
quay_username)
|
||||
mail.send(msg)
|
||||
|
||||
|
||||
|
|
Reference in a new issue