Skip to content

Commit ba39a51

Browse files
author
Илья
committed
Added timeout and canceled params
1 parent c83f4a3 commit ba39a51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Session.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,15 +371,15 @@ public function query($yql, array $parameters = null, array $options = [])
371371
$operationParams = new OperationParams();
372372
if(isset($options['operation_timeout_ms'])){
373373
$seconds = intdiv( $options['operation_timeout_ms'], 1000); // get seconds
374-
$nanos = $options['operation_timeout_ms'] % 1000 * 1000000; // get ns
374+
$nanos = fmod($options['operation_timeout_ms'], 1000) * 1000000; // get ns
375375
$operationParams->setOperationTimeout(new Duration([
376376
'seconds' => $seconds,
377377
'nanos' => $nanos
378378
]));
379379
}
380380
if(isset($options['cancel_after_ms'])){
381381
$seconds = intdiv( $options['cancel_after_ms'], 1000); // get seconds
382-
$nanos = $options['cancel_after_ms'] % 1000 * 1000000; // get ns
382+
$nanos = fmod($options['operation_timeout_ms'], 1000) * 1000000; // get ns
383383
$operationParams->setCancelAfter(new Duration([
384384
'seconds' => $seconds,
385385
'nanos' => $nanos

0 commit comments

Comments
 (0)