Hello,
I’ve built an app which takes excel data - manipulates it, and:
- creating an item if there is no item yet
- insert the column values if there is an item on the board.
We are talking about huge amount of data that need to be insert (2500~ items)
Here is the example of the integration:
export async function post(boardId, project, token) {
try {
const mondayClient = initMondayClient()
await mondayClient.setToken(token)
for (let i = 0; i < 2500~; i++) {
console.log('start of loop')
const task = ...
const taskId = ...
const taskName = ...
const itemId = await _getItemId(taskId, boardId, token)
const columnValues = JSON.stringify({
....
})
if (!itemId) await deleyFunc(_createItem, 2000, boardId, columnValues, taskName, mondayClient, token)
else await deleyFunc(_changeItem, 2000, boardId, itemId, columnValues, mondayClient, token)
console.log('end of loop')
}
} catch (err) {
console.log('file: monday-service.ts -> line 57 -> post-> err', err)
}
}
async function _createItem(boardId, columnValues, taskName: string, mondayClient, token) {
try {
await mondayClient.setToken(token)
const mutation= `mutation {
create_item(board_id: ${boardId}, item_name: ${JSON.stringify(taskName)}, column_values:${JSON.stringify(columnValues)}, create_labels_if_missing: true) {
id
}
}`
const mutationResponse = await mondayClient.api(mutation)
console.log('item created')
} catch (err) {
console.log('file: monday-service.ts -> line 90 -> _createItem -> err', err)
}
}
async function _changeItem(boardId, itemId, columnValues, mondayClient, token) {
try {
await mondayClient.setToken(token)
const mutation = `mutation {
change_multiple_column_values (item_id: ${itemId}, board_id: ${boardId}, column_values: ${JSON.stringify(columnValues)}, create_labels_if_missing: true) {
id
}
}`
const mutationResponse = await mondayClient.api(mutation)
console.log('columns changed')
} catch (err) {
console.log('file: monday-service.ts -> line 109 -> _changeItem -> err', err)
}
}
In the first 300-400 items everything goes smooth, but then, I can see on my logs that the integration fires/executes again. The integration runs a few times in parallel.
I have simple console log right after entering to the base url endpoint:
Oct 19 11:53:49.123 fire
Oct 19 11:58:49.166 fire
Oct 19 11:59:19.166 fire
Oct 19 12:01:22.162 fire
We can see that the integration executes again after a few minutes which is a problem.
The integration triggered by button click. I obviously clicked once.
On the “Integrations Activity” I see only one activity and not many. But the integration is definitely repeating itself.
What can cause this? Thanks for any ideas.