Skip to content

Commit

Permalink
log track plugin status
Browse files Browse the repository at this point in the history
  • Loading branch information
panaaj committed May 15, 2021
1 parent 1f27833 commit 8ad2722
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/skstream.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ function getTracks() {
`?radius=${targetFilter.maxRadius}` :
`?radius=10000`; // default radius if none supplied
apiGet(apiUrl + '/tracks' + filter)
.then( r=> {
.then( r=> {
hasTrackPlugin= true;
// update ais vessels track data
Object.entries(r).forEach( (t:any)=> {
Expand All @@ -276,9 +276,12 @@ function getTracks() {
v.track= t[1].coordinates;
appendTrack(v);
}
});
});
})
.catch( (err)=> {hasTrackPlugin= false });
.catch( (err)=> {
hasTrackPlugin= false;
console.warn('Unable to fetch AIS tracks!');
});
}

function openStream(opt:any) {
Expand Down Expand Up @@ -470,6 +473,7 @@ function startTimers() {
}
timers.push(
setInterval( ()=> {
console.warn('hasTrackPlugin', hasTrackPlugin);
if(hasTrackPlugin) { getTracks() }
}, 60000 )
);
Expand Down

0 comments on commit 8ad2722

Please sign in to comment.