Skip to content

Don't show run-from-package warning in core tools #678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/loadScriptFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import * as path from 'path';
import * as url from 'url';
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
import { WorkerChannel } from './WorkerChannel';
import { AzFuncSystemError } from './errors';
import { PackageJson } from './parsers/parsePackageJson';
import { WorkerChannel } from './WorkerChannel';
import LogCategory = rpc.RpcLog.RpcLogCategory;
import LogLevel = rpc.RpcLog.Level;

Expand Down Expand Up @@ -39,7 +39,11 @@ function warnIfLongLoadTime(channel: WorkerChannel, filePath: string, start: num
const timeElapsed = Date.now() - start;
const rfpName = 'WEBSITE_RUN_FROM_PACKAGE';
const rfpValue = process.env[rfpName];
if (timeElapsed > 1000 && (rfpValue === undefined || rfpValue === '0')) {
if (
timeElapsed > 1000 &&
(rfpValue === undefined || rfpValue === '0') &&
process.env.AZURE_FUNCTIONS_ENVIRONMENT !== 'Development' // don't show in core tools
) {
channel.log({
message: `Loading "${path.basename(filePath)}" took ${timeElapsed}ms`,
level: LogLevel.Warning,
Expand Down