Skip to content

Commit

Permalink
refactor: do not cache models import when running in hot mode
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Apr 25, 2024
1 parent 7a2540d commit 950ee51
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/access_tokens_guard/user_providers/lucid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class AccessTokensLucidUserProvider<
* for further operations.
*/
protected async getModel() {
if (this.model) {
if (this.model && !('hot' in import.meta)) {
return this.model
}

Expand Down
2 changes: 1 addition & 1 deletion modules/basic_auth_guard/user_providers/lucid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class BasicAuthLucidUserProvider<UserModel extends LucidAuthenticatable>
* for further operations.
*/
protected async getModel() {
if (this.model) {
if (this.model && !('hot' in import.meta)) {
return this.model
}

Expand Down
2 changes: 1 addition & 1 deletion modules/session_guard/user_providers/lucid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class SessionLucidUserProvider<UserModel extends LucidAuthenticatable>
* for further operations.
*/
protected async getModel() {
if (this.model) {
if (this.model && !('hot' in import.meta)) {
return this.model
}

Expand Down

0 comments on commit 950ee51

Please sign in to comment.