@@ -157,7 +157,7 @@ public function get(array $query, $runningResetDuration, $waitDurationInMillis =
157157
158158 //reset stuck messages
159159 $ this ->collection ->updateMany (
160- ['running ' => true , 'resetTimestamp ' => ['$lte ' => new \MongoDB \BSON \UTCDateTime (microtime (true ) * 1000 )]],
160+ ['running ' => true , 'resetTimestamp ' => ['$lte ' => new \MongoDB \BSON \UTCDateTime (( int )( microtime (true ) * 1000 ) )]],
161161 ['$set ' => ['running ' => false ]]
162162 );
163163
@@ -170,7 +170,7 @@ public function get(array $query, $runningResetDuration, $waitDurationInMillis =
170170 $ completeQuery ["payload. {$ key }" ] = $ value ;
171171 }
172172
173- $ completeQuery ['earliestGet ' ] = ['$lte ' => new \MongoDB \BSON \UTCDateTime (microtime (true ) * 1000 )];
173+ $ completeQuery ['earliestGet ' ] = ['$lte ' => new \MongoDB \BSON \UTCDateTime (( int )( microtime (true ) * 1000 ) )];
174174
175175 $ resetTimestamp = time () + $ runningResetDuration ;
176176 //ints overflow to floats
@@ -319,7 +319,7 @@ public function ackSend(array $message, array $payload, $earliestGet = 0, $prior
319319 }
320320
321321 //Ensure $earliestGet is between 0 and MONGO_INT32_MAX
322- $ earliestGet = min (max (0 , $ earliestGet ), self ::MONGO_INT32_MAX );
322+ $ earliestGet = min (max (0 , $ earliestGet * 1000 ), self ::MONGO_INT32_MAX );
323323
324324 $ toSet = [
325325 'payload ' => $ payload ,
@@ -329,7 +329,7 @@ public function ackSend(array $message, array $payload, $earliestGet = 0, $prior
329329 'priority ' => $ priority ,
330330 ];
331331 if ($ newTimestamp ) {
332- $ toSet ['created ' ] = new \MongoDB \BSON \UTCDateTime (microtime (true ) * 1000 );
332+ $ toSet ['created ' ] = new \MongoDB \BSON \UTCDateTime (( int )( microtime (true ) * 1000 ) );
333333 }
334334
335335 //using upsert because if no documents found then the doc was removed (SHOULD ONLY HAPPEN BY SOMEONE MANUALLY)
@@ -396,7 +396,7 @@ public function send(array $payload, $earliestGet = 0, $priority = 0.0)
396396 'resetTimestamp ' => new \MongoDB \BSON \UTCDateTime (self ::MONGO_INT32_MAX * 1000 ),
397397 'earliestGet ' => new \MongoDB \BSON \UTCDateTime ($ earliestGet * 1000 ),
398398 'priority ' => $ priority ,
399- 'created ' => new \MongoDB \BSON \UTCDateTime (microtime (true ) * 1000 ),
399+ 'created ' => new \MongoDB \BSON \UTCDateTime (( int )( microtime (true ) * 1000 ) ),
400400 ];
401401
402402 $ this ->collection ->insertOne ($ message );
0 commit comments