Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
Only mark breakpoints done when api call succeeds
Browse files Browse the repository at this point in the history
The first part of the TODO is deemed no longer necessary because we
already have our request handle retriest for transient errors.
  • Loading branch information
Matt Loring committed Jan 19, 2016
1 parent 0d9a312 commit 3550675
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lib/debuglet.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,19 +339,16 @@ Debuglet.prototype.completeBreakpoint_ = function(breakpoint) {
var that = this;

that.logger_.info('\tupdating breakpoint data on server', breakpoint.id);
// TODO: in case of transient errors, retry the update operation
// Put in the completed breakpoints map only when the update successfully
// completes. Otherwise - we refuse to set the breakpoint, but the server
// has never seen the update.
that.debugletApi_.updateBreakpoint(breakpoint, function(err/*, body*/) {
if (err) {
that.logger_.error('Unable to complete breakpoint on server', err);
} else {
// TODO(ofrobots): breakpoint may be holding on to a lot of data. We only
// need to remember the breakpoint id.
that.completedBreakpointMap_[breakpoint.id] = breakpoint;
that.removeBreakpoint_(breakpoint);
}
});
// TODO(ofrobots): breakpoint may be holding on to a lot of data. We only
// need to remember the breakpoint id.
that.completedBreakpointMap_[breakpoint.id] = breakpoint;
that.removeBreakpoint_(breakpoint);
};


Expand Down

0 comments on commit 3550675

Please sign in to comment.