@@ -157,7 +157,7 @@ public function get(array $query, $runningResetDuration, $waitDurationInMillis =
157
157
158
158
//reset stuck messages
159
159
$ 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 ) )]],
161
161
['$set ' => ['running ' => false ]]
162
162
);
163
163
@@ -170,7 +170,7 @@ public function get(array $query, $runningResetDuration, $waitDurationInMillis =
170
170
$ completeQuery ["payload. {$ key }" ] = $ value ;
171
171
}
172
172
173
- $ completeQuery ['earliestGet ' ] = ['$lte ' => new \MongoDB \BSON \UTCDateTime (microtime (true ) * 1000 )];
173
+ $ completeQuery ['earliestGet ' ] = ['$lte ' => new \MongoDB \BSON \UTCDateTime (( int )( microtime (true ) * 1000 ) )];
174
174
175
175
$ resetTimestamp = time () + $ runningResetDuration ;
176
176
//ints overflow to floats
@@ -319,7 +319,7 @@ public function ackSend(array $message, array $payload, $earliestGet = 0, $prior
319
319
}
320
320
321
321
//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 );
323
323
324
324
$ toSet = [
325
325
'payload ' => $ payload ,
@@ -329,7 +329,7 @@ public function ackSend(array $message, array $payload, $earliestGet = 0, $prior
329
329
'priority ' => $ priority ,
330
330
];
331
331
if ($ newTimestamp ) {
332
- $ toSet ['created ' ] = new \MongoDB \BSON \UTCDateTime (microtime (true ) * 1000 );
332
+ $ toSet ['created ' ] = new \MongoDB \BSON \UTCDateTime (( int )( microtime (true ) * 1000 ) );
333
333
}
334
334
335
335
//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)
396
396
'resetTimestamp ' => new \MongoDB \BSON \UTCDateTime (self ::MONGO_INT32_MAX * 1000 ),
397
397
'earliestGet ' => new \MongoDB \BSON \UTCDateTime ($ earliestGet * 1000 ),
398
398
'priority ' => $ priority ,
399
- 'created ' => new \MongoDB \BSON \UTCDateTime (microtime (true ) * 1000 ),
399
+ 'created ' => new \MongoDB \BSON \UTCDateTime (( int )( microtime (true ) * 1000 ) ),
400
400
];
401
401
402
402
$ this ->collection ->insertOne ($ message );
0 commit comments