@@ -171,6 +171,10 @@ internal void AddFunctionError(string functionName, string error)
171
171
172
172
protected virtual void Initialize ( )
173
173
{
174
+ string hostLogPath = Path . Combine ( ScriptConfig . RootLogPath , "Host" ) ;
175
+ string debugSentinelFileName = Path . Combine ( hostLogPath , ScriptConstants . DebugSentinelFileName ) ;
176
+ this . LastDebugNotify = File . GetLastWriteTime ( debugSentinelFileName ) ;
177
+
174
178
IMetricsLogger metricsLogger = ScriptConfig . HostConfig . GetService < IMetricsLogger > ( ) ;
175
179
if ( metricsLogger == null )
176
180
{
@@ -189,20 +193,13 @@ protected virtual void Initialize()
189
193
File . WriteAllText ( hostConfigFilePath , "{}" ) ;
190
194
}
191
195
192
- if ( ScriptConfig . HostConfig . IsDevelopment )
196
+ if ( ScriptConfig . HostConfig . IsDevelopment || InDebugMode )
193
197
{
198
+ // If we're in debug/development mode, use optimal debug settings
194
199
ScriptConfig . HostConfig . UseDevelopmentSettings ( ) ;
195
200
}
196
- else
197
- {
198
- // TEMP: Until https://github.com/Azure/azure-webjobs-sdk-script/issues/100 is addressed
199
- // we're using some presets that are a good middle ground
200
- ScriptConfig . HostConfig . Queues . MaxPollingInterval = TimeSpan . FromSeconds ( 10 ) ;
201
- ScriptConfig . HostConfig . Singleton . ListenerLockPeriod = TimeSpan . FromSeconds ( 15 ) ;
202
- }
203
201
204
202
string json = File . ReadAllText ( hostConfigFilePath ) ;
205
-
206
203
JObject hostConfig ;
207
204
try
208
205
{
@@ -251,10 +248,6 @@ protected virtual void Initialize()
251
248
TraceWriter = new ConsoleTraceWriter ( hostTraceLevel ) ;
252
249
}
253
250
254
- string hostLogPath = Path . Combine ( ScriptConfig . RootLogPath , "Host" ) ;
255
- string debugSentinelFileName = Path . Combine ( hostLogPath , ScriptConstants . DebugSentinelFileName ) ;
256
- this . LastDebugNotify = File . GetLastWriteTime ( debugSentinelFileName ) ;
257
-
258
251
_debugModeFileWatcher = new FileSystemWatcher ( hostLogPath , ScriptConstants . DebugSentinelFileName )
259
252
{
260
253
EnableRaisingEvents = true
0 commit comments