Skip to content

Commit

Permalink
Merge pull request #319 from HarryEMartland/retry-events
Browse files Browse the repository at this point in the history
adds retry when pull subscriptions fails
  • Loading branch information
agsh authored May 18, 2024
2 parents dc49b74 + cbefaa3 commit e946bc4
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 @@ -354,6 +354,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 e946bc4

Please sign in to comment.