cds-snc / covid-alert-server

Exposure Notification: Diagnosis Server implementation / Notification d’exposition : Mise en œuvre du serveur de diagnostic
Apache License 2.0
298 stars 31 forks source link

Convert expiration worker to a lambda #422

Open CalvinRodo opened 3 years ago

CalvinRodo commented 3 years ago

Description

Currently the expiration worker is run as part of the retrieval service.

While this is not having an impact on service performance it does introduce the possibility of a race condition.

This caused an issue where deleted OTKs were being counted multiple times. The issue has been resolved by using transactions but this caused a small increase in the number of DB connections needed.

Ideally this task should be handled by a microservice and run periodically during the day, it does not need to occur in the go microservices.

Expiration Server Code sits here: https://github.com/cds-snc/covid-alert-server/blob/master/pkg/workers/expiration.go

AC

CalvinRodo commented 3 years ago

While this would be a nice to have this hasn't been an issue since this was opened, will close and re-open if required.