Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ipgallery
/
mde
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Registry
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8e36c353
authored
Mar 15, 2017
by
Adi Amir
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
increase number of threads in handlers
parent
5b3433fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
cfg/config.properties
src/main/java/logic/GEManager.java
cfg/config.properties
View file @
8e36c353
...
@@ -6,6 +6,6 @@ log4j.prop.file.path=/logs/conf/log4j.xml
...
@@ -6,6 +6,6 @@ log4j.prop.file.path=/logs/conf/log4j.xml
### microservice/rest server
### microservice/rest server
server.port
=
50040
server.port
=
50040
server.host
=
0.0.0.0
server.host
=
0.0.0.0
server.worker.threads
=
4
server.worker.threads
=
10
src/main/java/logic/GEManager.java
View file @
8e36c353
...
@@ -61,6 +61,9 @@ public class GEManager {
...
@@ -61,6 +61,9 @@ public class GEManager {
String
error
=
null
;
String
error
=
null
;
BaseRestResponse
brr
=
new
BaseRestResponse
(
false
,
null
);
BaseRestResponse
brr
=
new
BaseRestResponse
(
false
,
null
);
long
tStart
=
System
.
currentTimeMillis
();
logger
.
info
(
"executeRequest() started: "
+
getApiIdString
(
apiIdAsParams
));
if
(
apiIdAsParams
.
length
==
1
&&
apiIdAsParams
[
0
].
equals
(
"cameras"
))
{
if
(
apiIdAsParams
.
length
==
1
&&
apiIdAsParams
[
0
].
equals
(
"cameras"
))
{
brr
=
getCameraList
(
requestContext
);
brr
=
getCameraList
(
requestContext
);
}
}
...
@@ -75,7 +78,7 @@ public class GEManager {
...
@@ -75,7 +78,7 @@ public class GEManager {
}
}
else
{
else
{
String
err
=
"executeRequest() failed. Unknown api: "
+
getApiIdString
(
apiIdAsParams
);
String
err
=
"executeRequest() failed. Unknown api: "
+
getApiIdString
(
apiIdAsParams
);
return
errorResponse
(
err
);
brr
=
errorResponse
(
err
);
}
}
// if the request failed due to invalid token - fetch a new one & try again
// if the request failed due to invalid token - fetch a new one & try again
...
@@ -85,10 +88,14 @@ public class GEManager {
...
@@ -85,10 +88,14 @@ public class GEManager {
brr
=
executeRequest
(
serviceId
,
apiIdAsParams
,
requestContext
);
brr
=
executeRequest
(
serviceId
,
apiIdAsParams
,
requestContext
);
}
}
else
{
else
{
return
errorResponse
(
"executeRequest() failed to obtain access token"
);
brr
=
errorResponse
(
"executeRequest() failed to obtain access token"
);
}
}
}
}
long
tEnd
=
System
.
currentTimeMillis
();
double
elapsedTime
=
((
double
)(
tEnd
-
tStart
))
/
1000.0
;
logger
.
info
(
"executeRequest finished:. time= "
+
elapsedTime
+
" success="
+
brr
.
success
+
" api="
+
getApiIdString
(
apiIdAsParams
));
return
brr
;
return
brr
;
}
}
...
@@ -529,7 +536,7 @@ public class GEManager {
...
@@ -529,7 +536,7 @@ public class GEManager {
private
String
getApiIdString
(
String
[]
apiIdAsParams
)
{
private
String
getApiIdString
(
String
[]
apiIdAsParams
)
{
String
apiString
=
""
;
String
apiString
=
""
;
for
(
String
p:
apiIdAsParams
)
for
(
String
p:
apiIdAsParams
)
apiString
+=
p
+
"
\"
"
;
apiString
+=
p
+
"
/
"
;
return
apiString
;
return
apiString
;
}
}
...
@@ -560,7 +567,7 @@ public class GEManager {
...
@@ -560,7 +567,7 @@ public class GEManager {
}
}
private
void
logHttpError
(
String
funcName
,
SimpleHttpResponse
httpResp
)
{
private
void
logHttpError
(
String
funcName
,
SimpleHttpResponse
httpResp
)
{
logger
.
error
(
"
statusCode="
+
httpResp
.
getStatusCode
()
+
" content="
+
httpResp
.
getContent
());
logger
.
error
(
funcName
+
" failed:"
+
"
statusCode="
+
httpResp
.
getStatusCode
()
+
" content="
+
httpResp
.
getContent
());
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment