Skip to content

Commit 3f0de23

Browse files
committed
fix!: make Tracing::init_trace() void and call on add_action()
1 parent dc582d7 commit 3f0de23

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Utils/Tracing.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function init() {
125125
return;
126126
}
127127

128-
add_filter( 'do_graphql_request', [ $this, 'init_trace' ] );
128+
add_action( 'do_graphql_request', [ $this, 'init_trace' ] );
129129
add_action( 'graphql_execute', [ $this, 'end_trace' ], 99, 0 );
130130
add_filter( 'graphql_access_control_allow_headers', [ $this, 'return_tracing_headers' ] );
131131
add_filter(
@@ -143,14 +143,10 @@ public function init() {
143143

144144
/**
145145
* Sets the timestamp and microtime for the start of the request
146-
*
147-
* @return float
148146
*/
149-
public function init_trace() {
147+
public function init_trace(): void {
150148
$this->request_start_microtime = microtime( true );
151149
$this->request_start_timestamp = $this->format_timestamp( $this->request_start_microtime );
152-
153-
return $this->request_start_timestamp;
154150
}
155151

156152
/**

0 commit comments

Comments
 (0)