Skip to content
Open
15 changes: 15 additions & 0 deletions agent/fw_laravel_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,14 @@ NR_PHP_WRAPPER(nr_laravel_queue_queue_createpayload) {
}
NR_PHP_WRAPPER_END

NR_PHP_WRAPPER(nr_laravel_horizon_end) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer a name like nr_laravel_horizon_end_txn to be more clear what this function does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, updated the name: f049a15

NR_UNUSED_SPECIALFN;
(void)wraprec;

nr_php_txn_end(1, 0 TSRMLS_CC);
}
NR_PHP_WRAPPER_END

void nr_laravel_queue_enable(TSRMLS_D) {
/*
* Hook the command class that implements Laravel's queue:work command so
Expand Down Expand Up @@ -892,6 +900,13 @@ void nr_laravel_queue_enable(TSRMLS_D) {
nr_laravel_queue_workcommand_handle TSRMLS_CC);
#endif

nr_php_wrap_user_function_before_after_clean(
NR_PSTR("Laravel\\Horizon\\Console\\HorizonCommand::handle"),
nr_laravel_horizon_end, NULL, NULL);

nr_php_wrap_user_function_before_after_clean(
NR_PSTR("Laravel\\Horizon\\Console\\SupervisorCommand::handle"),
nr_laravel_horizon_end, NULL, NULL);
/*
* Hook the method that creates the JSON payloads for queued jobs so that we
* can add our metadata for CATMQ.
Expand Down
Loading