-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[0.19]: change value of parameter "w" from 0 to 1 in XHGui\Saver\MongoSaver.save #358
base: 0.19.x
Are you sure you want to change the base?
Conversation
does this change return value? does it make used call to throw on failure? |
Seems the answer is "makes code to throw" as the pipeline fails now with duplicate key errors:
|
Sorry, the reply is a little late The official document describes the value of the w parameter as follows: https://www.php.net/manual/zh/mongo.writeconcerns.php If mongodb fails to perform the insert operation, such as primary key conflict, in the case of w= 0, the program will directly return true, and the user will not get any error prompt. I guess w = 0 is set for performance consideration, but in the debugging stage, it may cause some problems. Maybe the better choice is to parameterize. The value is 0 in debugging and 1 in production phase |
If you agree with me, I'll be happy to modify the code in this way. Thanks for your time. |
self::getLastProfilingId() makes no more sense and should be deleted. you can see the discussion here: it should actually return new value each time when called so the import.php can work for missing id-s. w=1 can't be used with current code, as the unit test will fail, the unit tests need to be fixed first. likely needs to have support code to check if id already exists, and skip |
also, you need to rebase against current master this branch to catch up changes to CI |
Revert unintended close: |
change value of parameter "w" from 0 to 1 in XHGui\Saver\MongoSaver.save,so that function will return clear tip when insert data to mongodb failed.