Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/read from last used #2092

Merged
merged 3 commits into from
Jan 23, 2024
Merged

Task/read from last used #2092

merged 3 commits into from
Jan 23, 2024

Conversation

jzbahrai
Copy link
Collaborator

@jzbahrai jzbahrai commented Jan 23, 2024

Summary | Résumé

We want to store the last time an api_key is used in the api_key table.
Changes made:

  1. Add a function to update the api key last used timestamp
  2. Update persist_notification and persist_notifications to store the last_used_timestamp
  3. Change the get_last_used api_key to use the last_used_timestamp from the api_key table

Testing locally

  1. Run the migration to add the last_used column (its on main already)
  2. Check the api_key table for one of your services
  3. Send a message using an api_key, in your database you should see the last_used_timestamp for the api_key to be populated
Screenshot 2024-01-23 at 2 53 21 PM

https://app.zenhub.com/workspaces/notify-planning-614b3ad91bc2030015ed22f5/issues/gh/cds-snc/notification-planning/1413

Copy link
Member

@andrewleith andrewleith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - tested locally and works as descibed.

This should be a LOT faster! Nice work! 🎉 ⏩

@jzbahrai jzbahrai merged commit 463becb into main Jan 23, 2024
4 checks passed
@jzbahrai jzbahrai deleted the task/read-from-last-used branch January 23, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants