Skip to content

Commit

Permalink
noop in notify if env var is present
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbushi committed Feb 3, 2025
1 parent 4c99c1e commit 8188718
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions js/core/src/reflection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,24 +225,25 @@ export class ReflectionServer {
});

server.post('/api/notify', async (request, response) => {
const { telemetryServerUrl, reflectionApiSpecVersion } = request.body;
const url = process.env.GENKIT_TELEMETRY_SERVER ?? telemetryServerUrl;
setTelemetryServerUrl(url);
logger.debug(`Connected to telemetry server on ${url}`);
if (reflectionApiSpecVersion !== GENKIT_REFLECTION_API_SPEC_VERSION) {
if (
!reflectionApiSpecVersion ||
reflectionApiSpecVersion < GENKIT_REFLECTION_API_SPEC_VERSION
) {
logger.warn(
'WARNING: Genkit CLI version may be outdated. Please update `genkit-cli` to the latest version.'
);
} else {
logger.warn(
'Genkit CLI is newer than runtime library. Some feature may not be supported. ' +
'Consider upgrading your runtime library version (debug info: expected ' +
`${GENKIT_REFLECTION_API_SPEC_VERSION}, got ${reflectionApiSpecVersion}).`
);
if (!process.env.GENKIT_TELEMETRY_SERVER) {
const { telemetryServerUrl, reflectionApiSpecVersion } = request.body;
setTelemetryServerUrl(telemetryServerUrl);
logger.debug(`Connected to telemetry server on ${telemetryServerUrl}`);
if (reflectionApiSpecVersion !== GENKIT_REFLECTION_API_SPEC_VERSION) {
if (
!reflectionApiSpecVersion ||
reflectionApiSpecVersion < GENKIT_REFLECTION_API_SPEC_VERSION
) {
logger.warn(
'WARNING: Genkit CLI version may be outdated. Please update `genkit-cli` to the latest version.'
);
} else {
logger.warn(
'Genkit CLI is newer than runtime library. Some feature may not be supported. ' +
'Consider upgrading your runtime library version (debug info: expected ' +
`${GENKIT_REFLECTION_API_SPEC_VERSION}, got ${reflectionApiSpecVersion}).`
);
}
}
}
response.status(200).send('OK');
Expand Down

0 comments on commit 8188718

Please sign in to comment.