Skip to content

Commit

Permalink
Move check for WEBSITE_INSTANCE_ID to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeavon committed Mar 6, 2024
1 parent ec19cae commit 1ff2b67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ public class RuntimeValidatorsComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.RuntimeModeValidators()
.AddAzureLoadBalancingValidators();
// check running on a Azure Web App
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID")))
{
builder.RuntimeModeValidators()
.AddAzureLoadBalancingValidators();
}
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@ public static class RuntimeValidatorBuilderExtensions
{
public static RuntimeModeValidatorCollectionBuilder AddAzureLoadBalancingValidators(this RuntimeModeValidatorCollectionBuilder builder)
{
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID")))
{
return builder
.Add<TempFilesValidator>()
.Add<HostSyncValidator>()
.Add<ExamineValidator>();
}

return builder;
}
}
}

0 comments on commit 1ff2b67

Please sign in to comment.