some fix for handling configuration change and recycling (#539)
This commit is contained in:
parent
9c4a784891
commit
d61a4ca89f
|
|
@ -28,8 +28,8 @@ public:
|
||||||
);
|
);
|
||||||
|
|
||||||
GLOBAL_NOTIFICATION_STATUS
|
GLOBAL_NOTIFICATION_STATUS
|
||||||
OnGlobalConfigurationChange(
|
OnGlobalApplicationStop(
|
||||||
_In_ IGlobalConfigurationChangeProvider * pProvider
|
_In_ IHttpApplicationStopProvider * pProvider
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,14 @@ APPLICATION_MANAGER::ShutDown()
|
||||||
|
|
||||||
// clean up the hash table so that the application will be informed on shutdown
|
// clean up the hash table so that the application will be informed on shutdown
|
||||||
m_pApplicationInfoHash->Clear();
|
m_pApplicationInfoHash->Clear();
|
||||||
|
|
||||||
ReleaseSRWLockExclusive(&m_srwLock);
|
ReleaseSRWLockExclusive(&m_srwLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// stop filewatcher monitoring thread
|
||||||
|
if (m_pFileWatcher != NULL)
|
||||||
|
{
|
||||||
|
delete m_pFileWatcher;
|
||||||
|
m_pFileWatcher = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -201,8 +201,9 @@ HRESULT
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = pModuleInfo->SetGlobalNotifications(
|
hr = pModuleInfo->SetGlobalNotifications(
|
||||||
pGlobalModule,
|
pGlobalModule,
|
||||||
GL_CONFIGURATION_CHANGE | GL_STOP_LISTENING);
|
GL_APPLICATION_STOP | // Configuration change trigers IIS application stop
|
||||||
|
GL_STOP_LISTENING); // worker process stop or recycle
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -34,14 +34,14 @@ ASPNET_CORE_GLOBAL_MODULE::OnGlobalStopListening(
|
||||||
// Recycled the corresponding core app if its configuration changed
|
// Recycled the corresponding core app if its configuration changed
|
||||||
//
|
//
|
||||||
GLOBAL_NOTIFICATION_STATUS
|
GLOBAL_NOTIFICATION_STATUS
|
||||||
ASPNET_CORE_GLOBAL_MODULE::OnGlobalConfigurationChange(
|
ASPNET_CORE_GLOBAL_MODULE::OnGlobalApplicationStop(
|
||||||
_In_ IGlobalConfigurationChangeProvider * pProvider
|
_In_ IHttpApplicationStopProvider * pProvider
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UNREFERENCED_PARAMETER(pProvider);
|
|
||||||
|
|
||||||
// Retrieve the path that has changed.
|
// Retrieve the path that has changed.
|
||||||
PCWSTR pwszChangePath = pProvider->GetChangePath();
|
IHttpApplication* pApplication = pProvider->GetApplication();
|
||||||
|
|
||||||
|
PCWSTR pwszChangePath = pApplication->GetAppConfigPath();
|
||||||
|
|
||||||
// Test for an error.
|
// Test for an error.
|
||||||
if (NULL != pwszChangePath &&
|
if (NULL != pwszChangePath &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue