Toggle navigation
Toggle navigation
This project
Loading...
Sign in
digsig
/
digsig-services
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Stefan Huber
2017-03-27 12:22:19 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6a594acdacee94f9c41296194b585d3292cb84d2
6a594acd
1 parent
224f2a81
timeout after 2000 millis in local network
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
src/services/rest.ts
src/services/rest.ts
View file @
6a594ac
...
...
@@ -2,6 +2,7 @@ import {Injectable} from '@angular/core';
import
{
Http
,
Response
,
Headers
}
from
'@angular/http'
;
import
{
DeviceInfo
}
from
'./../api/device-info'
;
import
{
Node
}
from
'./../api/node'
;
import
'rxjs/add/operator/timeout'
export
const
ERROR_CODE_UNAUTHORIZED
:
string
=
"unauthorized"
;
export
const
ERROR_CODE_NOT_FOUND
:
string
=
"not-found"
;
...
...
@@ -100,6 +101,7 @@ export class Rest {
return
new
Promise
<
Node
>
((
resolve
,
reject
)
=>
{
if
(
node
&&
node
.
IP
)
{
this
.
http
.
get
(
"http://"
+
node
.
IP
+
":"
+
Rest
.
localWebPort
+
"/device"
)
.
timeout
(
2000
)
.
subscribe
(
response
=>
{
try
{
let
body
=
response
.
json
();
...
...
Please
register
or
login
to post a comment