[0.19]: change value of parameter "w" from 0 to 1 in XHGui\Saver\MongoSaver.save#358
[0.19]: change value of parameter "w" from 0 to 1 in XHGui\Saver\MongoSaver.save#358ym2048 wants to merge 1 commit intoperftools:0.19.xfrom
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: |
|
Perhaps this could be made configurable from config for different user choices |
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.