Skip to content

Commit

Permalink
fix: replace action name with backend.MIDDLEWARE_ACTIONS enum
Browse files Browse the repository at this point in the history
  • Loading branch information
akumatus committed Sep 18, 2020
1 parent c8275fb commit d5e21a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ Agent.prototype._open = function() {
}

var request = {data: chunk};
agent.backend.trigger('receive', agent, request, function(err) {
agent.backend.trigger(backend.MIDDLEWARE_ACTIONS.receive, agent, request, function(err) {
var callback = function(err, message) {
agent._reply(request.data, err, message);
};
Expand Down
4 changes: 2 additions & 2 deletions lib/submit-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ SubmitRequest.prototype.apply = function(callback) {
this.channels = this.backend.getChannels(this.collection, this.id);

var request = this;
this.backend.trigger('apply', this.agent, this, function(err) {
this.backend.trigger(backend.MIDDLEWARE_ACTIONS.apply, this.agent, this, function(err) {
if (err) return callback(err);

// Apply the submitted op to the snapshot
Expand All @@ -145,7 +145,7 @@ SubmitRequest.prototype.apply = function(callback) {
SubmitRequest.prototype.commit = function(callback) {
var request = this;
var backend = this.backend;
backend.trigger('commit', this.agent, this, function(err) {
backend.trigger(backend.MIDDLEWARE_ACTIONS.commit, this.agent, this, function(err) {
if (err) return callback(err);

// Try committing the operation and snapshot to the database atomically
Expand Down

0 comments on commit d5e21a2

Please sign in to comment.