Skip to content

Commit 3f2bc99

Browse files
📈 Only fire entrypoint detected on initial activation (#122)
1 parent 540ab37 commit 3f2bc99

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

‎src/appDiscovery.ts‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ async function parsePyprojectForEntryPoint(
137137
*/
138138
export async function discoverFastAPIApps(
139139
parser: Parser,
140+
trackTelemetry = false,
140141
): Promise<AppDefinition[]> {
141142
const workspaceFolders = vscode.workspace.workspaceFolders
142143
if (!workspaceFolders) {
@@ -229,14 +230,16 @@ export async function discoverFastAPIApps(
229230
)
230231
}
231232

232-
// Track entrypoint detection per workspace folder
233-
trackEntrypointDetected({
234-
duration_ms: folderTimer(),
235-
method: detectionMethod,
236-
success: folderApps.length > 0,
237-
routes_count: folderRoutes.length,
238-
routers_count: countRouters(folderApps),
239-
})
233+
// Track entrypoint detection per workspace folder (initial discovery only)
234+
if (trackTelemetry) {
235+
trackEntrypointDetected({
236+
duration_ms: folderTimer(),
237+
method: detectionMethod,
238+
success: folderApps.length > 0,
239+
routes_count: folderRoutes.length,
240+
routers_count: countRouters(folderApps),
241+
})
242+
}
240243
}
241244

242245
if (apps.length === 0) {

‎src/extension.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export async function activate(context: vscode.ExtensionContext) {
105105

106106
try {
107107
// Discover apps and create providers
108-
apps = await discoverFastAPIApps(parserService)
108+
apps = await discoverFastAPIApps(parserService, true)
109109
} catch (error) {
110110
success = false
111111
trackActivationFailed(error, "discovery")

0 commit comments

Comments
 (0)