Refactor high volume into serialised service model

Just looks a bit tidier and less repetitive.

I’ve only done this for the serialised service because:
- we’re only checking this in places where we’re already using the
  serialised service
- if we want to check this elsewhere there’s a good chance that new code
  should be using the serialised service, since it’ll itself be doing
  some kind of performance optimisation
This commit is contained in:
Chris Hill-Scott
2021-06-02 10:58:57 +01:00
parent 467794c212
commit 57249b43c8
3 changed files with 8 additions and 3 deletions

View File

@@ -87,7 +87,7 @@ def send_sms_to_provider(notification):
statsd_client.timing("sms.test-key.total-time", delta_seconds)
else:
statsd_client.timing("sms.live-key.total-time", delta_seconds)
if str(service.id) in current_app.config.get('HIGH_VOLUME_SERVICE'):
if service.high_volume:
statsd_client.timing("sms.live-key.high-volume.total-time", delta_seconds)
else:
statsd_client.timing("sms.live-key.not-high-volume.total-time", delta_seconds)
@@ -142,7 +142,7 @@ def send_email_to_provider(notification):
statsd_client.timing("email.test-key.total-time", delta_seconds)
else:
statsd_client.timing("email.live-key.total-time", delta_seconds)
if str(service.id) in current_app.config.get('HIGH_VOLUME_SERVICE'):
if service.high_volume:
statsd_client.timing("email.live-key.high-volume.total-time", delta_seconds)
else:
statsd_client.timing("email.live-key.not-high-volume.total-time", delta_seconds)