File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -133,11 +133,25 @@ public async Task<IActionResult> Message([HttpTrigger(AuthorizationLevel.Anonymo
133133 await message . React ( functionOptions . ReactOnMessage ) . SendAsync ( whatsapp ) . Ignore ( ) ;
134134
135135 if ( hosting . IsDevelopment ( ) )
136- // Process inline to speed up local devloop
137- await runner . ProcessAsync ( json ) ;
136+ {
137+ // Avoid enqueing to speed up local devloop
138+ _ = Task . Run ( async ( ) =>
139+ {
140+ try
141+ {
142+ await runner . ProcessAsync ( json ) ;
143+ }
144+ catch ( Exception e )
145+ {
146+ logger . LogError ( e , "Failed to process message" ) ;
147+ }
148+ } ) ;
149+ }
138150 else
151+ {
139152 // Otherwise, enqueue the message processing
140153 await messageProcessor . EnqueueAsync ( json ) ;
154+ }
141155 }
142156 else
143157 {
You can’t perform that action at this time.
0 commit comments