Skip to content

feat: add --no-reload flag to disable hot reload in local commands - #47

Closed
cortex-assistant[bot] wants to merge 1 commit into
developfrom
fix/no-reload-flag
Closed

feat: add --no-reload flag to disable hot reload in local commands#47
cortex-assistant[bot] wants to merge 1 commit into
developfrom
fix/no-reload-flag

Conversation

@cortex-assistant

Copy link
Copy Markdown

Fixes #46.

Adds a --no-reload flag to sam local start-api and sam local start-lambda commands that disables the watchdog-based file observer for hot reloading. This is particularly useful on Windows where Microsoft Defender can cause extreme latency (2-5 minutes) during the recursive directory scanning performed by the file watcher.

When --no-reload is specified:

  • Warm containers still function normally
  • File system observers are not created
  • No hot reload / automatic code change detection

Changes:

  • Added --no-reload CLI option in options.py
  • Threaded the flag through start-api and start-lambda CLI commands
  • Updated InvokeContext to accept and propagate the flag
  • Conditionally skip LambdaFunctionObserver creation in WarmLambdaRuntime via a _NoOpObserver
  • Added unit tests for the new flag

@bnusunny bnusunny closed this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: SAM Local Flag to Disable Hot Reload

2 participants