Need to remove priority logic

This commit is contained in:
Kenneth Kehl
2024-08-09 09:11:28 -07:00
parent fc87696818
commit 2e7e6e81fc
11 changed files with 5 additions and 192 deletions

View File

@@ -11,7 +11,6 @@ from app.cloudfoundry_config import cloud_config
class QueueNames(object):
PERIODIC = "periodic-tasks"
PRIORITY = "priority-tasks"
DATABASE = "database-tasks"
SEND_SMS = "send-sms-tasks"
CHECK_SMS = "check-sms_tasks"
@@ -30,7 +29,6 @@ class QueueNames(object):
@staticmethod
def all_queues():
return [
QueueNames.PRIORITY,
QueueNames.PERIODIC,
QueueNames.DATABASE,
QueueNames.SEND_SMS,

View File

@@ -33,20 +33,6 @@ def dao_get_provider_versions(provider_id):
)
def _adjust_provider_priority(provider, new_priority):
current_app.logger.info(
f"Adjusting provider priority - {provider.identifier} going from {provider.priority} to {new_priority}"
)
provider.priority = new_priority
# Automatic update so set as notify user
provider.created_by_id = current_app.config["NOTIFY_USER_ID"]
# update without commit so that both rows can be changed without ending the transaction
# and releasing the for_update lock
_update_provider_details_without_commit(provider)
def _get_sms_providers_for_update(time_threshold):
"""
Returns a list of providers, while holding a for_update lock on the provider details table, guaranteeing that those
@@ -86,11 +72,7 @@ def get_provider_details_by_notification_type(
if supports_international:
filters.append(ProviderDetails.supports_international == supports_international)
return (
ProviderDetails.query.filter(*filters)
.order_by(asc(ProviderDetails.priority))
.all()
)
return ProviderDetails.query.filter(*filters).all()
@autocommit
@@ -135,7 +117,6 @@ def dao_get_provider_stats():
ProviderDetails.id,
ProviderDetails.display_name,
ProviderDetails.identifier,
ProviderDetails.priority,
ProviderDetails.notification_type,
ProviderDetails.active,
ProviderDetails.updated_at,
@@ -149,7 +130,6 @@ def dao_get_provider_stats():
.outerjoin(User, ProviderDetails.created_by_id == User.id)
.order_by(
ProviderDetails.notification_type,
ProviderDetails.priority,
)
.all()
)

View File

@@ -168,11 +168,7 @@ def send_notification(notification_type):
reply_to_text=template.reply_to_text,
)
if not simulated:
queue_name = (
QueueNames.PRIORITY
if template.process_type == TemplateProcessType.PRIORITY
else None
)
queue_name = None
send_notification_to_queue(notification=notification_model, queue=queue_name)
else:

View File

@@ -23,7 +23,6 @@ def get_providers():
"id": row.id,
"display_name": row.display_name,
"identifier": row.identifier,
"priority": row.priority,
"notification_type": row.notification_type,
"active": row.active,
"updated_at": row.updated_at,

View File

@@ -80,11 +80,7 @@ def send_one_off_notification(service_id, post_data):
client_reference=client_reference,
)
queue_name = (
QueueNames.PRIORITY
if template.process_type == TemplateProcessType.PRIORITY
else None
)
queue_name = None
send_notification_to_queue(
notification=notification,

View File

@@ -176,11 +176,7 @@ def process_sms_or_email_notification(
)
if not simulated:
queue_name = (
QueueNames.PRIORITY
if template_process_type == TemplateProcessType.PRIORITY
else None
)
queue_name = None
send_notification_to_queue_detached(
key_type=api_user.key_type,
notification_type=notification_type,