Skip to content
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

Skip file watching in ReadOnly mode #2451

Merged
merged 1 commit into from
Feb 23, 2018
Merged

Skip file watching in ReadOnly mode #2451

merged 1 commit into from
Feb 23, 2018

Conversation

mathewc
Copy link
Member

@mathewc mathewc commented Feb 22, 2018

Another change related to #2230. If we're in ReadOnly mode, we don't need to be monitoring script files for changes. The other set of changes were in #2428.

@@ -92,6 +84,15 @@ public ScriptHostManager(ScriptHostConfiguration config, IScriptEventManager eve
_structuredLogWriter = new StructuredLogWriter(EventManager, config.RootLogPath);
_performanceManager = hostPerformanceManager ?? new HostPerformanceManager(settingsManager, _config.HostHealthMonitor);

if (config.FileWatchingEnabled && !settingsManager.FileSystemIsReadOnly)
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the check for !settingsManager.FileSystemIsReadOnly redundant here, since you set FileWatchingEnabled to false if it's read-only?

Copy link
Member Author

@mathewc mathewc Feb 23, 2018

Choose a reason for hiding this comment

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

Unfortunately no - this ctor is called before any hosts are created/initialized. This is the manager of hosts so creates them later. A little confusing as is I agree. At this point FileWatchingEnabled will always have the default value of true and that only changes later when we read host.json config. We might be able to improve this later.

@mathewc mathewc merged commit 6fc6559 into v1.x Feb 23, 2018
@mathewc mathewc deleted the readonly branch February 23, 2018 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants