Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Convert expiration worker to a lambda #422

Open
CalvinRodo opened this issue Jan 22, 2021 · 1 comment
Open

Convert expiration worker to a lambda #422

CalvinRodo opened this issue Jan 22, 2021 · 1 comment

Comments

@CalvinRodo
Copy link
Member

CalvinRodo commented Jan 22, 2021

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

  • Write a lambda in chalice that will clean up the expired keys on a regular schedule
  • lambda is monitered using x-ray
  • lambda is deployed using TF
@CalvinRodo
Copy link
Member Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant