From 950ee519cf3d9c473484dc4aa601dec8be9402ac Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Thu, 25 Apr 2024 12:56:00 +0530 Subject: [PATCH] refactor: do not cache models import when running in hot mode --- modules/access_tokens_guard/user_providers/lucid.ts | 2 +- modules/basic_auth_guard/user_providers/lucid.ts | 2 +- modules/session_guard/user_providers/lucid.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/access_tokens_guard/user_providers/lucid.ts b/modules/access_tokens_guard/user_providers/lucid.ts index 8448158..162144f 100644 --- a/modules/access_tokens_guard/user_providers/lucid.ts +++ b/modules/access_tokens_guard/user_providers/lucid.ts @@ -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 } diff --git a/modules/basic_auth_guard/user_providers/lucid.ts b/modules/basic_auth_guard/user_providers/lucid.ts index d723956..27a4744 100644 --- a/modules/basic_auth_guard/user_providers/lucid.ts +++ b/modules/basic_auth_guard/user_providers/lucid.ts @@ -42,7 +42,7 @@ export class BasicAuthLucidUserProvider * for further operations. */ protected async getModel() { - if (this.model) { + if (this.model && !('hot' in import.meta)) { return this.model } diff --git a/modules/session_guard/user_providers/lucid.ts b/modules/session_guard/user_providers/lucid.ts index 0993a01..8442a69 100644 --- a/modules/session_guard/user_providers/lucid.ts +++ b/modules/session_guard/user_providers/lucid.ts @@ -45,7 +45,7 @@ export class SessionLucidUserProvider * for further operations. */ protected async getModel() { - if (this.model) { + if (this.model && !('hot' in import.meta)) { return this.model }