File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -697,10 +697,18 @@ function createDefaultGitHubExecutor(): GitHubQueryExecutor {
697697 } ) ;
698698}
699699
700- const executorSingleton = createDefaultGitHubExecutor ( ) ;
700+ let executorSingleton : GitHubQueryExecutor | undefined ;
701701const cacheConfigSingleton = getCacheConfigFromEnv ( ) ;
702702const cacheStoreSingleton = createCacheStore ( cacheConfigSingleton ) ;
703703
704+ function getDefaultGitHubExecutor ( ) : GitHubQueryExecutor {
705+ if ( ! executorSingleton ) {
706+ executorSingleton = createDefaultGitHubExecutor ( ) ;
707+ }
708+
709+ return executorSingleton ;
710+ }
711+
704712/**
705713 * Redis cache entry shape that includes a fetch timestamp for staleness checks.
706714 */
@@ -811,7 +819,10 @@ export async function getUserData(
811819 }
812820
813821 // ── 3. Fetch from GitHub API ──────────────────────────────────────────
814- const { data : fresh , metrics } = await fetchUserDataFromGitHub ( executorSingleton , normalizedUsername ) ;
822+ const { data : fresh , metrics } = await fetchUserDataFromGitHub (
823+ getDefaultGitHubExecutor ( ) ,
824+ normalizedUsername ,
825+ ) ;
815826
816827 // Upsert into PostgreSQL
817828 try {
You can’t perform that action at this time.
0 commit comments