Skip to content

Commit

Permalink
adds retry when pull subscriptions fails
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryEMartland committed May 13, 2024
1 parent 8d7aefc commit cbefaa3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/cam.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ var Cam = function(options, callback) {
this.path = options.path || '/onvif/device_service';
this.timeout = options.timeout || 120000;
this.agent = options.agent || false;
this.eventReconnectms = options.eventReconnectms;
/**
* Force using hostname and port from constructor for the services
* @type {boolean}
Expand Down
2 changes: 2 additions & 0 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ module.exports = function(Cam) {
this.createPullPointSubscription(function(error) {
if (!error) {
this._eventPull();
} else if (this.eventReconnectms) {
setTimeout(() => this._eventRequest(), this.eventReconnectms);
}
}.bind(this));
} else {
Expand Down

0 comments on commit cbefaa3

Please sign in to comment.