Skip to content

Commit

Permalink
fix: show Background Function plan warning only if site is connected (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoboucas authored Nov 9, 2021
1 parent 1147a47 commit 1622898
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/functions/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ const runtimes = require('./runtimes')
const { watchDebounced } = require('./watcher')

class FunctionsRegistry {
constructor({ capabilities, config, projectRoot, timeouts }) {
constructor({ capabilities, config, isConnected = false, projectRoot, timeouts }) {
this.capabilities = capabilities
this.config = config
this.isConnected = isConnected
this.projectRoot = projectRoot
this.timeouts = timeouts

Expand Down Expand Up @@ -128,7 +129,7 @@ class FunctionsRegistry {
return
}

if (func.isBackground && !this.capabilities.backgroundFunctions) {
if (func.isBackground && this.isConnected && !this.capabilities.backgroundFunctions) {
warn(getLogMessage('functions.backgroundNotSupported'))
}

Expand Down
1 change: 1 addition & 0 deletions src/lib/functions/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ const startFunctionsServer = async ({
const functionsRegistry = new FunctionsRegistry({
capabilities,
config,
isConnected: Boolean(siteUrl),
projectRoot: site.root,
timeouts,
})
Expand Down

1 comment on commit 1622898

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 365 MB

Please sign in to comment.