Skip to content

Commit 1a06a97

Browse files
author
Dogukan Erenel
committed
* Added Service check status reading custom instance ID
* NLC cache is off on service status check
1 parent caa6490 commit 1a06a97

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

Scripts/Services/Dialog/Dialog.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,22 @@ public CheckServiceStatus( Dialog service, ServiceStatus callback )
459459
m_Service = service;
460460
m_Callback = callback;
461461

462-
if (! m_Service.GetDialogs( OnGetDialogs ) )
463-
OnFailure( "Failed to invoke GetDialogs()." );
462+
string customServiceID = Config.Instance.GetVariableValue(SERVICE_ID+"_ID");
463+
464+
//If custom classifierID is defined then we are using it to check the service health
465+
if(!string.IsNullOrEmpty(customServiceID)){
466+
467+
if (! m_Service.Converse( customServiceID, "Hello", OnDialog ) )
468+
OnFailure( "Failed to invoke Converse()." );
469+
else
470+
m_DialogCount += 1;
471+
}
472+
else{
473+
if (! m_Service.GetDialogs( OnGetDialogs ) )
474+
OnFailure( "Failed to invoke GetDialogs()." );
475+
}
476+
477+
464478
}
465479

466480
private void OnGetDialogs( Dialogs dialogs )

Scripts/Services/NaturalLanguageClassifier/NaturalLanguageClassifier.cs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,25 @@ public CheckServiceStatus( NaturalLanguageClassifier service, ServiceStatus call
512512
m_Service = service;
513513
m_Callback = callback;
514514

515-
if (! m_Service.GetClassifiers( OnCheckServices ) )
516-
OnFailure( "Failed to call GetClassifiers()" );
515+
string customClassifierID = Config.Instance.GetVariableValue(SERVICE_ID+"_ID");
516+
m_Service.DisableCache = true;
517+
//If custom classifierID is defined then we are using it to check the service health
518+
if(!string.IsNullOrEmpty(customClassifierID)){
519+
520+
if (! m_Service.GetClassifier(customClassifierID, OnCheckService ) )
521+
{
522+
OnFailure( "Failed to call GetClassifier()" );
523+
}
524+
else
525+
{
526+
m_GetClassifierCount += 1;
527+
}
528+
}
529+
else{
530+
if (! m_Service.GetClassifiers( OnCheckServices ) )
531+
OnFailure( "Failed to call GetClassifiers()" );
532+
}
533+
517534
}
518535

519536
private void OnCheckServices( Classifiers classifiers )

0 commit comments

Comments
 (0)