@@ -361,9 +361,9 @@ NR_PHP_WRAPPER(nr_laravel_queue_worker_after) {
361
361
* Illuminate\\Queue\\SyncQueue::executeJob is called again
362
362
*/
363
363
364
- if (NULL != auto_segment -> error ) {
365
- /* An exception occurred we need to record it on the txn if it isn't already
366
- * there. */
364
+ if (NULL == nr_php_get_return_value ( NR_EXECUTE_ORIG_ARGS ) ) {
365
+ /* An exception occurred and we need to record it on the txn if it isn't
366
+ * already there. */
367
367
if (NULL == NRPRG (txn )-> error ) {
368
368
/* Since we are ending this txn within the wrapper, and we know it has an
369
369
error, apply it to the txn; otherwise, the
@@ -387,28 +387,13 @@ NR_PHP_WRAPPER(nr_laravel_queue_worker_after) {
387
387
}
388
388
389
389
nr_php_txn_end (0 , 0 TSRMLS_CC );
390
- nr_php_txn_begin (NULL , NULL TSRMLS_CC );
391
- }
392
- NR_PHP_WRAPPER_END
393
-
394
- /*
395
- * Handles:
396
- * Illuminate\\Queue\\Worker::process
397
- * Illuminate\\Queue\\SyncQueue::executeJob
398
- */
399
-
400
- NR_PHP_WRAPPER (nr_laravel_queue_worker_stop_after ) {
401
- NR_UNUSED_SPECIALFN ;
402
- (void )wraprec ;
403
- NR_PHP_WRAPPER_REQUIRE_FRAMEWORK (NR_FW_LARAVEL );
404
- /*
405
- * Anytime the worker is considering whether to stop or not (or actually
406
- * stopping), we can ignore everything that's happened previously (sleeping
407
- * etc) that is non job processing related and avoid a useless txn.
408
- */
409
-
410
- nr_php_txn_end (0 , 0 TSRMLS_CC );
411
- nr_php_txn_begin (NULL , NULL TSRMLS_CC );
390
+ /* Let's give it some rudimentary name so it won't be unknown in case we exit
391
+ * and this becomes a txn.*/
392
+ if (NR_SUCCESS == nr_php_txn_begin (NULL , NULL TSRMLS_CC )) {
393
+ nr_txn_set_as_background_job (NRPRG (txn ), "Laravel queue worker process" );
394
+ nr_txn_set_path ("Laravel" , NRPRG (txn ), "Laravel queue worker process" ,
395
+ NR_PATH_TYPE_CUSTOM , NR_OK_TO_OVERWRITE );
396
+ }
412
397
}
413
398
NR_PHP_WRAPPER_END
414
399
@@ -975,23 +960,6 @@ void nr_laravel_queue_enable(TSRMLS_D) {
975
960
NR_PSTR ("Illuminate\\Queue\\SyncQueue::raiseBeforeJobEvent" ),
976
961
nr_laravel_queue_worker_raiseBeforeJobEvent_before , NULL , NULL );
977
962
978
- /*
979
- * Additional cleanup so we don't help prevent a useless excess txn after the
980
- * worker ends. Anytime the worker is questioning whether it should stop or is
981
- * going to stop, we can end the txn.
982
- */
983
- if (0 ) {
984
- nr_php_wrap_user_function_before_after_clean (
985
- NR_PSTR ("Illuminate\\Queue\\Worker::stopIfNecessary" ), NULL ,
986
- nr_laravel_queue_worker_stop_after , NULL );
987
- nr_php_wrap_user_function_before_after_clean (
988
- NR_PSTR ("Illuminate\\Queue\\Worker::stopWorkerIfLostConnection" ), NULL ,
989
- nr_laravel_queue_worker_stop_after , NULL );
990
- nr_php_wrap_user_function_before_after_clean (
991
- NR_PSTR ("Illuminate\\Queue\\Worker::stop" ), NULL ,
992
- nr_laravel_queue_worker_stop_after , NULL );
993
- }
994
-
995
963
#else
996
964
997
965
/*
0 commit comments