Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
a032bb3f
Commit
a032bb3f
authored
Jul 11, 2019
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define non-resumable error codes in a single array
parent
4c6f7ceb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
ChangeStream.php
src/ChangeStream.php
+6
-4
No files found.
src/ChangeStream.php
View file @
a032bb3f
...
@@ -40,9 +40,11 @@ class ChangeStream implements Iterator
...
@@ -40,9 +40,11 @@ class ChangeStream implements Iterator
*/
*/
const
CURSOR_NOT_FOUND
=
43
;
const
CURSOR_NOT_FOUND
=
43
;
private
static
$errorCodeCappedPositionLost
=
136
;
private
static
$nonResumableErrorCodes
=
[
private
static
$errorCodeInterrupted
=
11601
;
136
,
// CappedPositionLost
private
static
$errorCodeCursorKilled
=
237
;
237
,
// CursorKilled
11601
,
// Interrupted
];
private
$resumeCallable
;
private
$resumeCallable
;
private
$iterator
;
private
$iterator
;
...
@@ -173,7 +175,7 @@ class ChangeStream implements Iterator
...
@@ -173,7 +175,7 @@ class ChangeStream implements Iterator
return
false
;
return
false
;
}
}
if
(
in_array
(
$exception
->
getCode
(),
[
self
::
$errorCodeCappedPositionLost
,
self
::
$errorCodeCursorKilled
,
self
::
$errorCodeInterrupted
]
))
{
if
(
in_array
(
$exception
->
getCode
(),
self
::
$nonResumableErrorCodes
))
{
return
false
;
return
false
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment