Skip to content

Conversation

@mistahj67
Copy link
Contributor

Description

Plumb context into gorm permission db methods
https://gorm.io/docs/context.html#Context-Timeout

I also removed the unused db method CreatePermission

Motivation and Context

Currently as it stands any endpoints that rely on purely gorm do not respect request.Context and as such timeouts are not respected either. While we want to eventually get to the removal of the gorm dependency altogether, that is a long way and a lot of effort away and this I think this approach would give us that much room to maneuver while we get there.

How Has This Been Tested?

Using a rest client and the prefer header
Add a sleep inside of the handler
Look for the 500 request timed out after exceeding the timeout. (Note: the request will take as long as the sleep is set, it's not tied to the prefer header)

Types of changes

  • Chore (a change that does not modify the application functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Documentation updates are needed, and have been made accordingly.
  • I have added and/or updated tests to cover my changes.
  • All new and existing tests passed.
  • My changes include a database migration.

@mistahj67 mistahj67 force-pushed the BED-4183 branch 3 times, most recently from 4139978 to 59f6dce Compare March 7, 2024 19:25
Base automatically changed from BED-4183 to main March 7, 2024 19:37
@mistahj67 mistahj67 merged commit cce7e6f into main Mar 7, 2024
@mistahj67 mistahj67 deleted the BED-4230 branch March 7, 2024 22:32
@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants