Last active
September 5, 2018 15:13
-
-
Save wmakeev/c5932f289b9bf23af662d7e865014332 to your computer and use it in GitHub Desktop.
Дублирование имен документов #moysklad #bug #support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const fetch = require('node-fetch') | |
const Moysklad = require('moysklad').compose(require('moysklad-extension-queue')) | |
const ms = Moysklad({ | |
fetch, | |
login: process.env.MOYSKLAD_LOGIN, | |
password: process.env.MOYSKLAD_PASSWORD, | |
queue: true | |
}) | |
// Получаем стандартный шаблон документа | |
ms.PUT('entity/internalorder/new', {}).then(template => { | |
// Для чистоты эксперимента убеждаемся, что поля name в объекте не будет | |
delete template.name | |
// Запускаем параллельно 100 запросов на создание документа | |
// (лимит на кол-во одновременных запросов к серверу учитывается) | |
for (let i = 0; i < 100; i++) { | |
ms.POST('entity/internalorder', template) | |
.then(doc => { console.log(doc.name) }) | |
.catch(err => { console.log(err.message) }) | |
} | |
}) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
00018 | |
00018 | |
00019 | |
00019 | |
00020 | |
00020 | |
00020 | |
00021 | |
00020 | |
00022 | |
00022 | |
00022 | |
00023 | |
00023 | |
00024 | |
00024 | |
00024 | |
00025 | |
00025 | |
00026 | |
00026 | |
00027 | |
00027 | |
00027 | |
00028 | |
00028 | |
00029 | |
00029 | |
00029 | |
00030 | |
00030 | |
00031 | |
Ошибка сохранения объекта: нарушено ограничение уникальности параметра 'name' | |
00031 | |
00032 | |
00033 | |
00034 | |
00035 | |
00036 | |
00032 | |
00037 | |
00037 | |
00037 | |
00037 | |
00038 | |
00039 | |
00040 | |
00040 | |
00041 | |
00042 | |
00043 | |
00044 | |
00044 | |
00045 | |
00045 | |
00046 | |
00046 | |
00047 | |
00048 | |
00048 | |
00049 | |
00050 | |
00051 | |
00051 | |
00052 | |
00053 | |
00054 | |
00054 | |
00054 | |
00055 | |
00055 | |
00056 | |
00057 | |
00058 | |
00058 | |
00059 | |
00060 | |
00061 | |
00062 | |
00063 | |
00063 | |
00064 | |
00064 | |
00065 | |
00066 | |
00066 | |
00067 | |
Ошибка сохранения объекта: нарушено ограничение уникальности параметра 'name' | |
00068 | |
00069 | |
00069 | |
00070 | |
00071 | |
00072 | |
00073 | |
00074 | |
00074 | |
00075 | |
00076 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment