mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Restore support for runtimeSyncDelivery flag
This commit is contained in:
		| @@ -540,10 +540,6 @@ class Flow { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     get asyncMessageDelivery() { | ||||
|         return asyncMessageDelivery | ||||
|     } | ||||
|  | ||||
|     send(sendEvents) { | ||||
|         // onSend - passed an array of SendEvent objects. The messages inside these objects are exactly what the node has passed to node.send - meaning there could be duplicate references to the same message object. | ||||
|         // preRoute - called once for each SendEvent object in turn | ||||
| @@ -650,12 +646,18 @@ function handlePreDeliver(flow,sendEvent, reportError) { | ||||
|             reportError(err,sendEvent); | ||||
|             return; | ||||
|         } else if (err !== false) { | ||||
|             setImmediate(function() { | ||||
|             if (asyncMessageDelivery) { | ||||
|                 setImmediate(function() { | ||||
|                     if (sendEvent.destination.node) { | ||||
|                         sendEvent.destination.node.receive(sendEvent.msg); | ||||
|                     } | ||||
|                 }) | ||||
|             } else { | ||||
|                 if (sendEvent.destination.node) { | ||||
|                     sendEvent.destination.node.receive(sendEvent.msg); | ||||
|  | ||||
|                 } | ||||
|             }) | ||||
|             } | ||||
|             // postDeliver - the message has been dispatched to be delivered asynchronously (unless the sync delivery flag is set, in which case it would be continue as synchronous delivery) | ||||
|             hooks.trigger("postDeliver", sendEvent, function(err) { | ||||
|                 if (err) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user