@MarventusWP wrote:
Ionic: 3.19.0
Angular: 5.0.3
Node: 6.9.5I have several Angular providers using HttpClient in my Ionic app hitting a Node.js server for data getting and storing.
I’m noticing an odd behavior whenever my node server is down or stopped (ERR_CONNECTION_REFUSED error):When I run the app on my dev machine with
ionic serve
, my provider hits the error callback between 3 to 5 seconds after the request.However, when I do the same on the actual built app (or running it with Ionic DevApp), the error callback gets hit a good 120 to 135 seconds after the request fires. Do I need to handle ERR_CONNECTION_REFUSED errors specially or is this a bug?
Below is the get method code from the service:
getUserData(){ this.loadingService.setLoadingState(true); this.mongoService.getUsers().subscribe( (response: any) => { this.loadingService.setLoadingState(false); this.mongoUsers = response; console.log("Mongo Users:", this.mongoUsers); }, (err: any) => { this.loadingService.setLoadingState(false); alert('user error'); } ) }
Thanks!
Posts: 1
Participants: 1