This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-41
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-41 by this push:
new 3c1b0f7 WIP.
3c1b0f7 is described below
commit 3c1b0f72038f5db6449a73ea56dc4381386daf40
Author: Sergey Kamov <[email protected]>
AuthorDate: Fri Aug 28 15:33:51 2020 +0300
WIP.
---
nlpcraft/src/main/resources/reference.conf | 1 +
.../inspections/inspectors/NCInspectorSynonymsSuggestions.scala | 8 ++++++--
.../scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala | 5 ++++-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/nlpcraft/src/main/resources/reference.conf
b/nlpcraft/src/main/resources/reference.conf
index a880f80..70cab90 100644
--- a/nlpcraft/src/main/resources/reference.conf
+++ b/nlpcraft/src/main/resources/reference.conf
@@ -17,5 +17,6 @@
# Request timeout property. Important for '/ask/sync' and '/model/inspect'
requests.
akka.http.server.request-timeout = 600s
+akka.http.server.idle-timeout = 600s
akka.http.server.remote-address-header = on
\ No newline at end of file
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/inspections/inspectors/NCInspectorSynonymsSuggestions.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/inspections/inspectors/NCInspectorSynonymsSuggestions.scala
index b72a392..3c45d3c 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/inspections/inspectors/NCInspectorSynonymsSuggestions.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/inspections/inspectors/NCInspectorSynonymsSuggestions.scala
@@ -249,13 +249,17 @@ object NCInspectorSynonymsSuggestions extends NCService
with NCInspector {
if (noExElems.nonEmpty)
warns +=
- "Some elements don't have synonyms in intent samples,
" +
+ "Some elements don't have synonyms in their intent
samples, " +
s"so the service can't suggest any new synonyms for
such elements: [${noExElems.mkString(", ")}]"
val allReqsCnt = allReqs.map(_._2.size).sum
val allSynsCnt = elemSyns.map(_._2.size).sum
- logger.info(s"Data prepared for ContextWord Server
[examples=${examples.size}, synonyms=$allSynsCnt, requests=$allReqsCnt]")
+ logger.info(s"Data prepared. Request is going to execute on
ContextWord Server " +
+ s"[examples=${examples.size}, " +
+ s"synonyms=$allSynsCnt, " +
+ s"requests=$allReqsCnt]"
+ )
if (allReqsCnt == 0)
NCInspection(
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala
index 96bdaa4..84256be 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala
@@ -48,6 +48,8 @@ import scala.concurrent.Future
import akka.http.scaladsl.coding.Coders
import org.apache.nlpcraft.common.inspections.NCInspectionType
+import scala.concurrent.duration.DurationInt
+
/**
* REST API default implementation.
*/
@@ -1770,6 +1772,7 @@ class NCBasicRestApi extends NCRestApi with LazyLogging
with NCOpenCensusTrace w
} ~
post {
encodeResponseWith(Coders.NoCoding, Coders.Gzip) {
+ withRequestTimeout(600.seconds) {
withRequestTimeoutResponse(_ ⇒ timeoutResp) {
path(API / "signin") {
withLatency(M_SIGNIN_LATENCY_MS, signin$) } ~
path(API / "signout") {
withLatency(M_SIGNOUT_LATENCY_MS, signout$) } ~ {
@@ -1813,7 +1816,7 @@ class NCBasicRestApi extends NCRestApi with LazyLogging
with NCOpenCensusTrace w
}
}}
}
- }
+ }}
}
)
}