##// END OF EJS Templates
Increment the pending_msgs counter immediately to avoid race conditions that send more messages
Jason Grout -
Show More
@@ -347,6 +347,7 define(["widgets/js/manager",
347 347 // We haven't exceeded the throttle, send the message like
348 348 // normal.
349 349 this.send_sync_message(attrs, callbacks);
350 this.pending_msgs++;
350 351 }
351 352 }
352 353 // Since the comm is a one-way communication, assume the message
@@ -395,8 +396,11 define(["widgets/js/manager",
395 396 }
396 397 }
397 398 that.comm.send({method: 'backbone', sync_data: state, buffer_keys: buffer_keys}, callbacks, {}, buffers);
398 that.pending_msgs++;
399 })
399 }).catch(utils.reject("Couldn't send widget sync message"), true)
400 .catch(function(error) {
401 that.pending_msgs--;
402 return error;
403 });
400 404 },
401 405
402 406 serialize: function(model, attrs) {
General Comments 0
You need to be logged in to leave comments. Login now